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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 "Create Table AS....."

Author  Topic 

pravin14u
Posting Yak Master

246 Posts

Posted - 2006-03-02 : 02:01:59
We can create table using the following syntax "Create table table1 as select * from table2"in ORACLE..... wat is the equivalent in transact SQL?

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-03-02 : 02:08:25
check select... into... from... in BOL

HTH

--------------------
keeping it simple...
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-03-02 : 02:27:34
Select * into newTable from oldtable

Note that newTable wont have any indices that oldtable has. To have it create the table with indices then write

Insert into newtable(columns)
Select columns from oldtable


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -