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
 Table Creation

Author  Topic 

babucxi
Starting Member

2 Posts

Posted - 2008-12-03 : 09:18:41
Hi Friends,

How to create a table from existing table with only structure but not the data

---
Babu

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-12-03 : 09:20:54
One of these

1 SELECT * into newtable FROM oldtable WHERE 1=0
2 Generate Script of oldtable;change name to newtable;run the script

Madhivanan

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

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-03 : 09:22:25
[code]SELECT TOP 0 * into newtable FROM oldtable [/code]
Go to Top of Page

babucxi
Starting Member

2 Posts

Posted - 2008-12-03 : 09:38:01
Hi Madhivanan/visahk16

Many Thanks

--Babu
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-03 : 09:39:39
Cheers
Go to Top of Page
   

- Advertisement -