WSU-CPD
asked on
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
Parameter of @LastPID is being supplied
What exactly do you want to do, Create a table then insert data into it
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
CREATE TABLE expects a set of column definitions. Try this:
Not sure off the top of my head if you can do this with Select *, you might have to pick some columns.
Select *
INTO [TempTable]
From [Direct_Construction]
where [PID] = @LastPID
Not sure off the top of my head if you can do this with Select *, you might have to pick some columns.
ASKER
Thank you! I have been beating my head against the wall on this one. Knew it was simple. Thanks!