Copy Rename Table in SQL Express
I want to copy and rename a table in SQL EXPRESS in an mdf data开发者_如何学运维base. Which is the best way to do this?
Try a
select * into [newtablename] from [oldtablename]
which will make a copy of your old table with a new name.
You can rename a table using sp_rename
. Note the warning (which will also appear when you run the stored proc):
Changing any part of an object name can break scripts and stored procedures.
精彩评论