title: Can I have SSDT Publish from Project Post Build
body: <p>I am trying to publish a database from a tfs gated build, I have tried a number of things and haven't succeeded yet.</p>
  
  <p>We are on vs2010 and hence it gets little difficult to achieve this.</p>
  
  <p>My last and incomplete try was -</p>
  
  <ul>
  <li><p>Have a post build script in sqlProject to call sqlPackage.exe with publish file name, and have a if condition on it to  check id its building inside visual studio or not.. for that I have following script that doesn't work.. I would be grateful if you can guide me on this ..</p>
  
  <pre><code>if '$(BuildingInsideVisualStudio)' == 'false' C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\SqlPackage.exe /a:Publish /pr:$(TF_BUILD_BINARIESDIRECTORY)\ReservingDatabaseSQL07.publish.xml /sf:$(TF_BUILD_BINARIESDIRECTORY)\ReservingDatabase.dacpac
  </code></pre></li>
  </ul>