clone database and rename

使用 management studio 

right click database -> Tasks -> Generate Scripts -> next until "Set Scripting Options" -> Advance  

Types of data to script 选择 Schema and data 

Script Full-Text Indexes  选择 True 

Script Triggers 选择 True 

next -> finish 

然后会生产 .sql file , open and rename database name then excute, done !

 

更新 : 2016-07-04 还有一个方法是通过 restore 的方式来实现 

refer : http://stackoverflow.com/questions/3829271/how-can-i-clone-an-sql-server-database-on-the-same-server-in-sql-server-2008-exp

和一般的 restore 步骤一样 

只是 Files 和 Options 要修改一下 

mssql 2012 和 2014 的 default setting 有区别,不过最终只要照下面这样就对了。

 

 

posted @ 2016-06-28 20:39  兴杰  阅读(236)  评论(0编辑  收藏  举报