最简单的方法是复制SQL Server DB来测试DB? [英] Easiest way to make copy SQL Server DB to test DB?
问题描述
使用SQL Server数据库并制作测试副本的最简单方法是什么?
What is the easiest way to take a SQL Server database and make a test copy of it?
我已经查看了一些现有的主题,但不确定是否更容易的方式。我有数据库发布者。
I have looked through some existing topics but not sure if there is an easier way. I have database publisher. I want to be able to keep both database on the same server, potentially.
更新:我使用Microsoft SQL Server发布向导来脚本化文件,创建一个新的数据库,添加use db,然后执行脚本。这似乎工作好。不建议使用附加/分离,因为如果是全文搜索数据库或缺少日志,则将链接返回到原始位置。
Update: I used the Microsoft SQL Server Publishing Wizard to script to file, create a new database, add "use db", and execute the script. This seemed to work okay. The attach/detach is not recommended because it leaves links back to the original location if it is a full text search database or if the log is missing.
推荐答案
我总是只是备份它,然后恢复到不同的名称/文件集; 如何:将数据库还原到新位置和名称(Transact-SQL)
或者你可以创建一个空的db&使用恢复向导启用OVERWRITE并更改恢复文件路径。
I always just back it up then restore to a different name/file set; How to: Restore a Database to a New Location and Name (Transact-SQL) or you can creater an empty db & use the restore "wizard" enabling OVERWRITE and changing the restore file paths.
这篇关于最简单的方法是复制SQL Server DB来测试DB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!