SQL statement error of "incorrect syntax near the keyword 'as'"

Why is this sql statement throwing an error of "incorrect syntax near the keyword 'as'" CREATE TABLE [TempTable] AS (Select * From [Direct_Construction] where [PID] = @LastPID)
Parameter of @LastPID is being supplied

Who is Participating?
derekkrommConnect With a Mentor Commented:
select * into [TempTable] from [Direct_Construction] where [PID] = @LastPID
Ephraim WangoyaCommented:
What exactly do you want to do, Create a table then insert data into it
CREATE TABLE expects a set of column definitions.  Try this:

Select *
INTO [TempTable] 
From [Direct_Construction] 
where [PID] = @LastPID

Open in new window

Not sure off the top of my head if you can do this with Select *, you might have to pick some columns.
WSU-CPDAuthor Commented:
Thank you!  I have been beating my head against the wall on this one.  Knew it was simple.  Thanks!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.