Saturday 19 July 2014

Publish Database Project from Microsoft Visual Studio 2013 to Microsoft SQL Server 2014 [Unable to connect to target server]

Update: This post also applies to solving issue for publishing database project to Microsoft SQL Server 2016.

You may have wanted to publish your database project to your newly installed Microsoft SQL Server 2014, but end up with this message "Unable to connect to target server". This is due to your current SQL Server Data Tools does not support publishing to SQL Server 2014. [Thanks to Sylvester Lee for pointing out that the current version Data Tools needs to update.] To solve this, you need to update your SQL Server Data Tools.

Visual Studio - Data Tools Operations Window

In your Visual Studio, navigate to your database project properties by right click on your database project and select properties. Select Project Settings tab. Under Target platform, check the drop down list whether it contain SQL Server 2014 selection. If it is not there, then you need to install SQL Server Data Tools.

Database Project - Properties - Project Settings Tab

Go to Extensions and Updates by select Tools at menu bar, which is located at the top of your Visual Studio window and click Extensions and Updates...

Visual Studio - TOOLS - Extensions and Updates Menu

At Extensions and Updates Window, select Updates tab and select Product Updates sub tab. At middle of the window, select Microsoft SQL Server Update for database... and click Update button.

Extensions and Updates Window

You will then be prompt to download SQL Server Data Tools.

View Downloads - Internet Explorer Window

Save it to keep a copy in your local machine to install it on a later date or run it immediately. The installation is pretty much straightforward and remember to read the terms and conditions before proceed with the installation.

Once you have done the installation, exit all your visual studio. Open back your project that contain the database project. You may have receive a prompt window to upgrade your project. Accept it by select OK button.

Review Project and Solution Changes Window

Check on the target platform at your database project properties. It should have contain SQL Server 2014 in the selection. Select the SQL Server 2014, save your properties and publish your project. By now your database project should be able to successfully publish to SQL Server 2014.


You may want to verify it in SQL Server Management Studio.


That all you have to do.




No comments:

Post a Comment