Search code examples
visual-studio-2012command-linecompilationdatabase-projectsql-server-data-tools

Compile an "SQL Server Database Project" project in Visual Studio 2012 from command-line?


What is the command-line to build an "SQL Server Database Project" project?

I try to google for this but I was filled with lots of posts on Visual Studio 2010 which is outdated.

Please share if you know how to.


Solution

  • Using the Visual Studio Developer command prompt, navigate to the project folder and type msbuild <projectname>.sqlproj.

    The default msbuild action is to build the project (it's possible to pass "/t:Build" in to explicitly call build).

    From a non-developer command prompt you'd just need to add MSBuild to the path.