开发者

Copy Rename Table in SQL Express

开发者 https://www.devze.com 2023-03-25 03:33 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消