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 

nooch
Starting Member

22 Posts

Posted - 2003-06-12 : 22:04:54
Hi all,

I read in my SAMS SQL book that you can copy a table using
CREATE TABLE <tablename> AS ...

Is this right, because i just can't seem to get it to work on my MS SQL Server 2000??

- Or does anyone know a way of copying a table into a new one? data and structure?

;) Danny

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-06-12 : 22:51:51
Hi

You can go :

SELECT *
INTO NewTableName
FROM OldTableName

and it will do what you want.

Damian
Go to Top of Page

nooch
Starting Member

22 Posts

Posted - 2003-06-12 : 23:02:55
Great stuff thanks a lot

Danny

Go to Top of Page
   

- Advertisement -