title: Sqlproj: Which solution to deploy a database in command line?
body: <p>I am currently deploying a website to a server by using the Microsoft Web Deployment technologies (msbuild and msdeploy commands). The website requires the deployment of a database and both will be in the same server. I am searching the best solution to deploy a database project (with a <strong>command line</strong>) and I would like to understand better all the technologies around database deployment. </p>
  
  <p><strong>Content of the solution</strong> (Visual Studio 2013): </p>
  
  <ul>
  <li>a database project (for SQL Server 2008), </li>
  <li>a class library (Data access layer with NHibernate)</li>
  <li>a web project (ASP.NET MVC4).</li>
  </ul>
  
  <p><strong>Note:</strong> I am not using voluntarily a continuous integration/delivery tool or publish method in VS. My first goal with this project was understanding how msbuild / msdeploy work...</p>
  
  <p>I had a look at the <a href="https://msdn.microsoft.com/en-us/library/dd193258%28v=vs.100%29.aspx" rel="nofollow">vsdbcmd</a> command which seems to do all the steps I want... except I would need to import Visual Studio DLLs/files into my remote server and I wonder if there is no better way... I also looked at the msdeploy providers <a href="https://msdn.microsoft.com/en-us/library/hh550081(v=vs.103).aspx" rel="nofollow">dbSqlPackage</a>/dbDacFx, but from what I understood, it is using a dacpac for applying the schema changes. Similarly, the SqlPackage.exe seems to use a dacpac as well. </p>
  
  <p>Using a dacpac sounds a good idea, but I am confused with the following questions:</p>
  
  <ul>
  <li>Does that mean that I would need a different process the first time my database is created? If yes, which command would be the best?</li>
  <li>Is it possible to create a dacpac from my sqlproj file? If yes, how to do it?</li>
  </ul>
  
  <p>Are there other ways of deploying from a command line and from your experiences and projects, what was the best way to deploy this kind of project? </p>
  
  <p>Many thanks,</p>