Build your SQL server database

VSTS | TFS 2018 | TFS 2017 | TFS 2015

Note

Build and release pipelines are called definitions in TFS 2018 and in older versions. Service connections are called service endpoints in TFS 2018 and in older versions.

Here we'll show you how to define your continuous integration (CI) process for your SQL server database project.

Get set up

For the instructions in this topic, you need a SQL server database project in Visual Studio.

Tip

If you don't yet have an app but want to try this out, then see the Q&A below.

Define your CI build process

Create the build pipeline

  1. Open your project in your web browser ▼

    Browse to project

    (If you don't see your project listed on the home page, select Browse.)

    • On-premises TFS: http://{your_server}:8080/tfs/DefaultCollection/{your_team_project}
    • VSTS: https://{your_organization}.visualstudio.com/DefaultCollection/{your_team_project}

    The TFS URL doesn't work for me. How can I get the correct URL?

  2. Create a build pipeline (Build and Release tab > Builds) ▼

    Build tab

  3. Select the .NET Desktop template.
  4. As the repository source, select the project, repository, and branch.

Enable continuous integration (CI)

On the Triggers tab, enable continuous integration (CI). This tells the system to queue a build whenever someone on your team commits or checks in new code.

Queue and test the build

Save the build pipeline and queue a new build by selecting the Queue new build command. Once the build is done, click Artifacts and then Explore to see the DACPAC (.dacpac file) produced by the build. This is the package that your release pipeline will consume to deploy your database.

Deploy your database

After you've run the build, you're ready to create a release pipeline to deploy your database to:

Q & A

How do I create an SQL server database solution?

  1. In Visual Studio, connect to your project.

  2. On the Team Explorer home page (Keyboard: Ctrl + 0, H), under Solutions, click New.

  3. Select the SQL Server templates section, and then choose the SQL Server Database Project template.

  4. Commit and push (Git) or check in (TFVC) your code.

I use TFS on-premises and I don't see some of these features. Why not?

Some of these features are available only on VSTS and not yet available on-premises. Some features are available on-premises if you have upgraded to the latest version of TFS.