Define a publish profile for SSDT


By:

Overview

As we saw in previous slides, publishing our database was pretty easy. However, there are many advanced publishing options and we don't want to re-apply any we want to change every time we want to publish.

Explanation

To alleviate the nuisance of re-entering publishing options you may want to always use (such as backing up the database before publish, for instance), you can save publish profiles and refer to them every time you want to publish. These profiles are XML based files that reside in the root folder of your project.

Let's see how we can define a publish profile. Right click on the Futbol project and choose Publish. You will again be presented with the Publish Properties dialog. Go through the previous steps to define the target instance and any Advanced options. Finally, on the main publish screen, choose Save Profile As:

Save Profile

You will then see that you will be given a Save dialog where you can save your choices to a file. Click Save to save the publish file and Cancel the publish (since all we want to do is just create a publish file).

Save Profile xml to OS

Once the file is saved, you will see that it appears within the Solution Explorer:

Solution Explorer

Now let's look at the contents of the publish file. Navigate to where the file was saved and open it with any text editor.

XML file contents

As you can see, it's just a XML file that will hold all the properties for your publish which you can refer to over and over again.






Comments For This Article

















get free sql tips
agree to terms