vsdbcmd how to provide the database variables when deploying?
- I tried the /p:sqlcmdvars:FileName parameter but it does not seem to be accepted. Also, I read that the default for this value should be the one included in the manifest.
Is there a way to make my variables persist in the project so they get included in the manifest. My variables are defined but when I do a manual shcema compare / write updates, I must click the "SQLCMD variables..." button and select the project variables manually. Is there a way to make this persist. I keep receiving those variable not defined errors when attempting vsdbcmd for deployment.
If not then what is the issue with my vsdbcmd command?
I tried with the colon:
vsdbcmd ... /p:sqlcmdvars:"a path including spaces and \ dot sqlcmdvars"
I get:
*** The specified property 'sqlcmdvars:a path including spaces and \ dot sqlcmdvars' is not valid. Properties are specified as name=value
I tried with the equal:
vsdbcmd ... /p:sqlcmdvars="a path including spaces and \ dot sqlcmdvars"
result is:
*** The specified property sqlcmdvars could not be used
I also tried with a space
vsdbcmd ... /p:sqlcmdvars "a path including spaces and \ dot sqlcmdvars"
none works.
My version is: Microsoft Visual Studio Team System 2008 Database Edition GDR Version 9.1.31124.01
Answers
- Hi Antoine,
I answerred this same question on another thread.
For the benefit of others, I repost here:
Hi Antoine,
Our docs may be outdated. Here is an example of the vsdbcmd command with switches to deploy the output from build:
"%programfiles%\microsoft visual studio 9.0\vstsdb\deploy\vsdbcmd"
/a:Deploy
/manifest:<Your Project Name>.deploymanifest
/p:DeploymentConfigurationFile=<"Database" or whatever you named it>.sqldeployment
/p:SqlCommandVariablesFile=<"Database" or whatever you named it>.sqlcmdvars
/cs:"Data Source=<Your SQL Server>\<Your SQL Instance>;Integrated Security=true"
- Marked As Answer byAntoine F Friday, December 19, 2008 10:44 PM
- Proposed As Answer byBarclay HillMSFT, ModeratorThursday, December 18, 2008 7:19 PM
You can do this with the help switch and the SQL DSP parameter.
Command Line Actions"%programfiles%\microsoft visual studio 9.0\vstsdb\deploy\vsdbcmd" /?
SQL DSP Import Options:"%programfiles%\microsoft visual studio 9.0\vstsdb\deploy\vsdbcmd"
/a:Import
/cs:"Data Source=<Your SQL Server>\<Your SQL Instance>;Integrated Security=true"
/dsp:sql
/?
SQL DSP Deploy Options:
"%programfiles%\microsoft visual studio 9.0\vstsdb\deploy\vsdbcmd"/a:Deploy
/cs:"Data Source=<Your SQL Server>\<Your SQL Instance>;Integrated Security=true"
/dsp:sql/?
- Proposed As Answer byBarclay HillMSFT, ModeratorFriday, December 19, 2008 11:10 PM
- Marked As Answer byAntoine F Tuesday, December 23, 2008 5:58 PM
All Replies
- Posted on Connect: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=387874
Please visit and validate as a bug if you also have this issue. - Hi Antoine,
I answerred this same question on another thread.
For the benefit of others, I repost here:
Hi Antoine,
Our docs may be outdated. Here is an example of the vsdbcmd command with switches to deploy the output from build:
"%programfiles%\microsoft visual studio 9.0\vstsdb\deploy\vsdbcmd"
/a:Deploy
/manifest:<Your Project Name>.deploymanifest
/p:DeploymentConfigurationFile=<"Database" or whatever you named it>.sqldeployment
/p:SqlCommandVariablesFile=<"Database" or whatever you named it>.sqlcmdvars
/cs:"Data Source=<Your SQL Server>\<Your SQL Instance>;Integrated Security=true"
- Marked As Answer byAntoine F Friday, December 19, 2008 10:44 PM
- Proposed As Answer byBarclay HillMSFT, ModeratorThursday, December 18, 2008 7:19 PM
- Thanks again!
This is really helpfull.
If it is possible, could you list the possible usable parameters until the documentation gets updated. Those you showed me so far are pretty much self explicit. You can do this with the help switch and the SQL DSP parameter.
Command Line Actions"%programfiles%\microsoft visual studio 9.0\vstsdb\deploy\vsdbcmd" /?
SQL DSP Import Options:"%programfiles%\microsoft visual studio 9.0\vstsdb\deploy\vsdbcmd"
/a:Import
/cs:"Data Source=<Your SQL Server>\<Your SQL Instance>;Integrated Security=true"
/dsp:sql
/?
SQL DSP Deploy Options:
"%programfiles%\microsoft visual studio 9.0\vstsdb\deploy\vsdbcmd"/a:Deploy
/cs:"Data Source=<Your SQL Server>\<Your SQL Instance>;Integrated Security=true"
/dsp:sql/?
- Proposed As Answer byBarclay HillMSFT, ModeratorFriday, December 19, 2008 11:10 PM
- Marked As Answer byAntoine F Tuesday, December 23, 2008 5:58 PM


