title: How to send a connection string as a parameter to MsBuild to perform SQL Schema Compare?
body: <p>The <a href="http://blogs.msdn.com/b/ssdt/archive/2014/07/15/msbuild-support-for-schema-compare-is-available.aspx" rel="noreferrer">SQL Server Data Tools team blog</a> mentions that it is now possible to use MsBuild to perform a schema comparison of two DacPacs or databases.  However, they do not mention exactly how to pass in the connection string to the source and target database.  If I set the parameter /p:source="my connection string" I get the error:</p>
  
  <blockquote>
    <p>MSBUILD : error MSB4177: Invalid property. The name "Initial Catalog"
    contains an invalid character " ".</p>
  </blockquote>
  
  <p>The command-line my PowerShell script sends to msbuild is:</p>
  
  <pre><code>msbuild ".\SchemaCompare.proj" /t:SqlSchemaCompare 
  /p:source="$sourceConnString" /p:target="$targetConnString" 
  /p:XmlOutput="$schemaCompareReportPath" 
  </code></pre>
  
  <p>where the SchemaCompare.proj contains the content suggested on the <a href="http://blogs.msdn.com/b/ssdt/archive/2014/07/15/msbuild-support-for-schema-compare-is-available.aspx" rel="noreferrer">SQL Server Data Tools team blog</a></p>