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.
| Author |
Topic |
|
yalgaar
Starting Member
43 Posts |
Posted - 2006-02-25 : 13:37:04
|
| How can I create a new table with a new name which is an exact copy of an existing table with:1) All rows2) no rows, only the structure of the table. |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2006-02-25 : 13:38:16
|
1. select * into NewTableName from OldTableName2. select * into NewTableName from OldTableName where 1=0Go with the flow & have fun! Else fight the flow |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2006-02-25 : 13:57:01
|
(Note that this will create the structure, in general, but not any secondary indexes, triggers, and other possibly "clutter" that the original table might have had)Its a pretty cool way to get stuff into a new table though ... K |
 |
|
|
|
|
|