Search code examples
sql-serversql-server-data-toolsdatabase-deployment

What is the syntax for adding multiple arguments onto the "Variables" parameter in sqlpackage.exe?


I am using SqlPackage.exe for my deployment. I have read the documentation here for the usage of SqlPackage.exe.

The documentation only states the synax for one variable:

Specifies a name value pair for an action specific variable; {VariableName}={Value}. The DACPAC file contains the list of valid SQLCMD variables. An error will result if a value is not provided for every variable.

My problem is that the documentation does not say how to pass multiple arguments into the Variables parameter. For example, I want to do this:

sqlpackage.exe ...args go here...  /Variables:VarToOverride=Value1,Var2ToOverride=Value2

Does anyone know the syntax for this?


Solution

  • I have managed to find something that works.

    sqlpackage.exe ...args go here... /Variables:VarToOverride=Value1 /Variables:Var2ToOverride=Value2

    It's not exactly what I was looking for, but it works.