Click here to Skip to main content
15,900,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,

I keep getting an error whenever I try to copy only structure of the existing table to new one.

This my code.

Thanks for your help

What I have tried:

CREATE TABLE NewSalesTable AS
(SELECT *
FROM Sales);

Error Msg: Incorrect syntax error near '('. Expecting ID.
Posted
Updated 30-May-17 8:07am

1 solution

 
Share this answer
 
Comments
Commish13 30-May-17 14:52pm    
Yes I sew that, but they use the SELECT and when I try to use CREATE I get the Error Msg
Richard Deeming 31-May-17 18:12pm    
You get the error message because the syntax you're using is not valid.

Use the syntax from the linked answer:
SELECT * INTO NewSalesTable FROM Sales WHERE 1 = 2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900