title: Specify a connection string when building sqlproj
body: <p>We have started using local SQL Servers (SQL 2012) for development. We have a tool that calls MSBUILD to deploy a SQL Project (.sqproj) to either our local, dev &amp; test databases.</p>
  
  <p>A requirement has come up where we want to use that tool to deploy to other local databases - it's a rare thing to do but needed.</p>
  
  <p>We have setup a .publish.xml file for each normal environment (dev.publish.xml, test.publish.xml, local.publish.xml, where local points to (local)\SQL2012).</p>
  
  <p>We normally run:</p>
  
  <pre><code>msbuild.exe /t:build;publish /p:SqlPublishProfilePath="Local.publish.xml" "c:\workspaces\greg\...\databaseProject.sqlproj"
  </code></pre>
  
  <p>That works fine as it takes the connection string from the local.publish.xml file and deploys the sql project to our local database.</p>
  
  <p>I'm not sure how to overwrite the publish file to make it point to a different database</p>
  
  <p>I've tried</p>
  
  <pre><code>msbuild.exe /t:build;publish /p:SqlPublishProfilePath="Local.publish.xml" /p:TargetConnectionString="Data Source=SomeOtherPC\SQL2012;Integrated Security=True;Pooling=False" "c:\workspaces\greg\...\databaseProject.sqlproj"
  </code></pre>
  
  <p>but it still points to (local)\sql2012 instead of SomeOtherPC\SQL2012</p>