SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Connecting to SQL Server 2017 using Visual Studio 2017 and getting “An incompatible SQL Server version detected”

This blog post details the error you may get when using Visual Studio 2017 and you get errors that you cannot connect to SQL Server 2017 using Test Explorer or SQL Server Object Explorer.

TL;DR – upgrade Visual Studio from base version…..

I had built a new DEMO machine for showcasing Visual Studio, namely SQL Server Data Tools as well as vendor tools that help people “do DevOps” stuff with databases.

I cloned my repository in my Azure Repo (read up on them here https://azure.microsoft.com/en-us/services/devops/repos/ ) and kicked off a BUILD in Azure DevOps  (read more here https://azure.microsoft.com/en-us/services/devops/ ) (formerly known as Visual Studio Team Services (VSTS)) and everything was going great.

I then wrote some unit tests for some stored procedures and went to build my solution in Visual Studio – which worked, then publish it to my local SQL Server 2017 instance – which failed.

The error was “Ensure you have the same name in master or <database>” which is a weird error.

Thing was – I had used Test Connection – which worked!!.

Initial Error
Don’t believe that things are OK…. while the Test Connection worked – nothing else did

But the actual publish failed – couldn’t connect…. (what???)

So I went to use SQL Server Object Explorer in Visual Studio to try and connect and got the following error:

error connecting VS
I couldn’t add my instance here – but could ‘Test Connection‘ in other parts of VS2017 (!??!)

I upgraded my SQL Server 2017 instance to CU11 – mainly as my version was base version:

SQL server Version Originally
In my defense I did only install this today……. 

But of course in reflection (reflected whilst I waited for CU11 to upgrade my instance) – I could connect to SQL Server 2016 instances. But couldn’t connect to my Azure SQL instances…

…..what the???

Which then made me check the version of Visual Studio 2017.

It was version 15.0 – and lo and behold there was an update waiting in notifications area telling me that an upgrade to 15.8.7 was ready to be installed.

<Groan>

So I upgraded……

VS_reboot.png
At least some things are consistent in Visual Studio  ??

…….and things now work:

Working Now
This now works – hooray
Working
Don’t worry – I did a Build first before I published!!

….and I can now (after a 2 hour hiatus of upgrades) go back to writing unit tests and running them against instances

 

Yip.

The Hybrid DBA's Blog

Hamish is a Systems Management Specialist with a passion for efficient application deployment using DevOPs methodologies. He has 19 years IT experience in managing large scale databases SQL Server technologies. He has been managing SQL Server since SQL Server 2000 and pragmatic architectural design is his main focus in his current job. Educating and helping others learn is a driver for Hamish and he is a PASS User Group Leader, International speaker and a repeat guest lecturer at a local university.

Comments

Leave a comment on the original post [hybriddbablog.com, opens in a new window]

Loading comments...