VS2010数据库项目备份位置
有没有办法在我的数据库项目设置中仅更改我的数据库的备份位置,或者我是否必须在预部署脚本中执行此操作,并从 部署之前取消选中备份数据库
代码>部署配置文件?
Is there a way to change the back up location for only my database in my database project settings or do I have to do that in a Pre-Deployment script and uncheck the back up database before deployment
from the Deployment configuration file
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
备份选项使用 SQL Server 默认备份目录。您只能通过编辑注册表来更改该位置。不幸的是,您无法为每个数据库设置不同的备份位置。
位置(对于 SQL 2008)
更改...
有关更改 SQL Server 默认路径的更多信息...
http://www.mssqltips.com/tip.asp?tip=1583
如果您喜欢冒险,可以更改部署前脚本中的注册表值,并使用部署后脚本重置它。使用“xp_instance_regread”和“xp_instance_regwrite”来执行此操作。 谨慎使用!
更多信息 -> http://sqladm.blogspot.com/2010/09/xpinstanceregwrite-syntax.html
如果您在部署脚本中注意到...读取注册表项的代码如下所示...
如果您小心的话,您可以在部署期间读取、更改和恢复路径部署。
希望这有帮助!
The backup option uses the SQL Server default backup directory. You can change that location only by editing the registry. Unfortunately, you can't set a different backup location for each database.
Location (For SQL 2008)
Change...
For more on changing SQL server default paths...
http://www.mssqltips.com/tip.asp?tip=1583
If you are feeling adventurous, you could change the registry value in your pre-deployment script and reset it with you post-deployment script. Use "xp_instance_regread" and "xp_instance_regwrite" to do that. USE WITH CAUTION!
More on that -> http://sqladm.blogspot.com/2010/09/xpinstanceregwrite-syntax.html
If you notice in your deployment script...the code to read the registry entry looks like this...
If you are careful, you could read, change, and restore the path during your deployment.
Hope this helps!