sqlnk
sqlnk

Reputation: 9

Msg 156, Level 15, State 1, Line 1 Incorrect syntax near the keyword select

How to overcome this? When I create a new table, I'm getting this error.

This is my query:

create table empnew 
as select * from emp;

And this is the error message:

Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'select'

Upvotes: 0

Views: 3023

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1269493

You have a SQL Server error. The correct syntax in that database is:

select e.*
into empnew
from emp e;

Upvotes: 3

Related Questions