Welcome to OverStack Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others


0 votes
in Technique[技术] by (71.8m points)

azure devops - SQL Server SqlPackage variables: are quotes needed around string variable?

When running sqlpackage.exe for deployments, do string variables require quotes around the word? It seems to be running successfully both ways. What is the correct syntax?

Two options shown here:



Resource: https://docs.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage?view=sql-server-ver15

Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

@Jeroen Mostert is right. It's more related to the command line not only the SqlPackage.

If the string variable contains spaces equality signs, slashes, or anything else that would interfere with option syntax, the value must be surrounded in "quotes".

Here is the example blog: https://www.addictivetips.com/windows-tips/enter-file-or-folder-paths-with-spaces-in-command-prompt-on-windows-10/

If all of the following conditions are met, then quote characters on the command line are preserved:

  • No /S switch (Strip quotes)
  • Exactly two quote characters
  • No special characters between the two quote characters, where special is one of: & < >( ) @ ^ |
  • There are one or more whitespace characters between the the two quote characters
  • The string between the two quote characters is the name of an executable file.

Ref: https://ss64.com/nt/syntax-cmd.html


Welcome to OverStack Developer Community-Open, Learning and Share