VS 2008数据库项目-部署' DatabaseName'期间不明确的 [英] VS 2008 Database Project - During Deploy 'DatabaseName' undefined
问题描述
我正在使用VS 2008,并且继承了我要部署的数据库项目.我正在做的部署是到一个新的数据库.(就像我要设置新安装一样)
I am using VS 2008 and have inhertied a database project that I am trying to deploy. The deploy I am doing is to a new database. (as if I were setting up a new installation)
部署操作是:创建Scrip并将其部署到数据库.
The Deploy Action is: Create Scrip and deploy to Database.
我收到以下错误:Schema.dbschema(0,0)错误TSD01268:SQL执行错误:发生致命错误.找不到变量DatabaseName.
I get the following error: Schema.dbschema(0,0)Error TSD01268: SQL Execution error: A fatal error occurred. The variable DatabaseName could not be found.
DatabaseName是在项目属性中定义的.
The DatabaseName is defined in the project properties.
如果我查看部署脚本,则会看到该声明已被注释掉.我可以删除注释并手动运行脚本,它可以工作,但是当我重新生成脚本时,声明会再次注释掉.
If I look a the deployment script I see the declaration is commented out. I can remove the comment and run the script manualy and it works, but when I regenerate the script the declaration is commented out again.
/*
:setvar DatabaseName "TestDb"
:setvar DefaultDataPath "C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\"
*/
GO
我搜索的设置会导致声明被注释掉,但未找到任何内容.
I have searched for a setting that would cause the declaration to be commented out, but haven't found anything.
我希望能够运行部署脚本而无需每次都对其进行编辑.
I want to be able to run the deployment script without editing it everytime.
推荐答案
找到了!
在Database.sqldeployment中,高级选项"下有一个名为"CommentOutSetVarDeclarations"的选项.
In Database.sqldeployment there is an option under Advanced Options called "CommentOutSetVarDeclarations".
这篇关于VS 2008数据库项目-部署' DatabaseName'期间不明确的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!