locked
vsdbcmd how to provide the database variables when deploying? RRS feed

  • Question

  • 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
    Wednesday, December 10, 2008 4:01 PM

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"

    Thursday, December 18, 2008 7:18 PM
    Moderator
  • 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

    /?

    Friday, December 19, 2008 11:10 PM
    Moderator

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.
    Friday, December 12, 2008 7:53 PM
  • 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"

    Thursday, December 18, 2008 7:18 PM
    Moderator
  • 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.
    Friday, December 19, 2008 10:54 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

    /?

    Friday, December 19, 2008 11:10 PM
    Moderator
  • HI Barclay,

     

    Could u please tel me where you are giving these statements.

    /a:Deploy

    /cs:"Data Source=<Your SQL Server>\<Your SQL Instance>;Integrated Security=true"

     

     

    /dsp:sql

    /?

    because when i tried to open vsdbcmd from the path, the window just opened and closed. i could not perform any operation.

    could you please tel me where should i give these commands.

     

    Thanks

     

     

     

    Wednesday, May 19, 2010 1:18 PM
  • VSDBCMD is a command line tool.  You need to run it from a command prompt or bat file so you can pass in the parameters it needs.

    Thanks,


    Barclay Hill Program Manager Visual Studio Data Tools (DataDude, DBPro, Database Edition, Database Projects, VS Data Tools) Please mark the responses as the answer if it resolves your question/issue. http://blogs.msdn.com/bahill
    Wednesday, May 19, 2010 6:54 PM
    Moderator