Click here to Skip to main content
15,910,981 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have database file ex.mdf when i tried to connect to this file from the visual Studio 2015 i get error message saying "Error: This server supports version 782 and earlier. A downgrade path is not supported."


What I have tried:

Hence i tried to install the ssdt tools for the database file which is created in the sqlserver 2016. Even after installing it is still using the sqlserver2014 how do i point my visual studio2015 to sqlserver2016.
Posted
Updated 8-May-17 23:41pm

1 solution

It's not Visual studio that's the problem: it's the version of SQL that teh DB file was created with.
Open SSMS, and open a new query window.
Enter the query:
SQL
DBCC CHECKPRIMARYFILE('PathToDataBaseFile',2)
And execute it. For example:
SQL
DBCC CHECKPRIMARYFILE('D:\Database Backups\SM_XRVCB.mdf',2)
The response you get includes the version number:
property           value
Database name      SM_XRVCB
Database version   706
Collation          53256
In this case, the file was created with V706, which is SQL Server 2012:
SQL Server Version	Internal Database Version
SQL Server 2016         852
SQL Server 2014         782
SQL Server 2012         706
SQL Server 2008 R2      660/661
SQL Server 2008         655
SQL Server 2005         611/612
SQL Server 2000         539
SQL Server 7            515
So if your error is saying V782, then it's SQL Server 2014, and the version number of the DB file cannot be higher than 782.
Then look at the instance you are connecting to (look at the connection string your code is using) and find out what version of SQL that server is (that's simple, SELECT @@VERSION will do it!). You need to point that connection string at the right server: I.e. 2016 or later in order to open the file.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900