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 |
|
jpotucek
Constraint Violating Yak Guru
273 Posts |
Posted - 2007-04-27 : 14:24:24
|
| What is the best way (short of backing up the entire DB) to make a copy of a Table so that It can be easily restored. We have a table that we want to make some serious changes to, but I want to make sure I can restore if if I need to (if the changes don't work) |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-04-27 : 14:35:30
|
| Here's what I do:SELECT *INTO SomeNewTableFROM YourTableThis doesn't copy over any constraints, indexes, or triggers. So if you want to save those too, then you should script them out and put them on SomeNewTable.Tara Kizerhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
jpotucek
Constraint Violating Yak Guru
273 Posts |
Posted - 2007-04-27 : 14:54:49
|
| THANKS! Then basically if I needed to restore the table, I could run the script to drop and recreate it and then copy the data back in?? |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-04-27 : 15:05:30
|
| Or you could just rename it to do the "restore".Tara Kizerhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
|
|
|