Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2013 schema compare: "Source is unavailable" when running against SQL Server 2016 Express

I'm trying to run a schema comparison using Visual Studio 2013.5 with SQL Server Data Tools 12.0.50730.0 against a SQL Server 2016 (13.0.300) Express database.

I can configure the source connection OK, and when I hit 'Test Connection' in the connection properties dialog it says "Test connection succeeded."

However, when I hit 'Compare' in the schema comparison window it says "Initializing Comparison..." for a few seconds, then "Source is unavailable: "

This only happens if I use a SQL Server 2016 as the source, other servers work fine.

Is this a bug?

EDIT: I have also tried using SSDT 14.0.50730.0 in VS2015 and I get the same error.

like image 752
Spongman Avatar asked Aug 26 '15 17:08

Spongman


People also ask

How do I compare two SQL databases in Visual Studio?

To compare database definitions. On the Tools menu, select SQL Server, and then click New Schema Comparison. Alternatively, right-click the TradeDev project in Solution Explorer, and select Schema Compare. The Schema Compare window opens, and Visual Studio automatically assigns it a name such as SqlSchemaCompare1 .

How do I create a SQL schema in Visual Studio?

Using SQL Server Management StudioIn Object Explorer, expand the Databases folder. Expand the database in which to create the new database schema. Right-click the Security folder, point to New, and select Schema.

How do I open an existing database in Visual Studio?

To connect to a database instance In Visual Studio, make sure that SQL Server Object Explorer is open. If it is not, click the View menu and select SQL Server Object Explorer. Right-click the SQL Server node in SQL Server Object Explorer and select Add SQL Server.


2 Answers

In Visual Studio 2017 I had the same issue and the only solution that worked for me was:

Close Visual Studio, open it and try again :) It seems to be a caching issue. Another option is to rename the DB but that's not a nice way of workarounding this issue.

like image 112
Francisco Goldenstein Avatar answered Oct 13 '22 18:10

Francisco Goldenstein


I was having the same problem connecting to AWS RDS instance. The only changes that I can tell caused the problem were upgrading to VS2015 and SSDT 14.0.61021.0

I added the following to the connection string and some combination of them fixed the problem:

;Connect Timeout=60;Encrypt=False;TrustServerCertificate=True;Persist Security Info=True

I figured this out by recreating the comparison then comparing the two .scmp files

like image 20
TechSavvySam Avatar answered Oct 13 '22 17:10

TechSavvySam