Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Create Table error

Author  Topic 

youruseridistoxic
Yak Posting Veteran

65 Posts

Posted - 2009-03-02 : 09:17:03
Hello,

When I execute this statement;

create table dbo.zz_Proj
as select * from dbo.Proj


I receive the following error;

Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'as'.


Is there an easy way to simply copy a table structure and contents w/o first defining all the columns in the destination table?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-02 : 09:19:56
select * into [dbo].zz_Proj from dbo.Proj
Go to Top of Page

youruseridistoxic
Yak Posting Veteran

65 Posts

Posted - 2009-03-02 : 09:25:17
quote:
Originally posted by visakh16

select * into [dbo].zz_Proj from dbo.Proj



Wunderbar. Thank you!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-02 : 09:28:26
welcome
Go to Top of Page
   

- Advertisement -