Share via


Cannot open database version 782. upgrade the database to the latest version.

Question

Wednesday, October 30, 2019 12:04 PM

Hi,

I'm trying to restore a SQL Server 2014 database backup on SQL server 2016. The DB restore commands works fine but when I try to issue SQL queries on SQL Server 2016 DB, I get following errors:
Cannot open database version 782. upgrade the database to the latest version.

It seems the DB is unable to upgrade the internal database version from 782 to 852 when we try to bring the database online using "alter database [DB_name] set online" command.

All replies (14)

Wednesday, October 30, 2019 1:17 PM

Hello Friend,

It is not really possible to restore a previous version database.
A 2016 version cannot be restored in the 2014 version.

If this answer has helped you, mark it helpful so that someone else with a question or similar problem can find an answer or help more easily. Jefferson Clyton Pereira da Silva - [MCSA | MCP | MCTS | MTA | Database Analyst - Sql Server and Oracle]


Wednesday, October 30, 2019 1:29 PM | 1 vote

You went from 2014 to 2016 with a successful restore?

What is the status of the database showing in SSMS?  Any Errors in the SQL errorlog?

22 years of database experience, most with SQL Server. Please 'Mark as answered' those posts that helped you.


Wednesday, October 30, 2019 2:57 PM

No, I'm restoring backup of 2014 version to 2016 SQL server database.


Wednesday, October 30, 2019 3:23 PM

Check the SQL Server ErrorLog file for Errors & reason why the database engine can't upgrade the database.

Olaf Helper

[ Blog] [ Xing] [ MVP]


Wednesday, October 30, 2019 3:26 PM

You cannot keep at the same time in the same AG group 782 and 852

Status db is in recovey?


Wednesday, October 30, 2019 8:52 PM

Hello Friend,

I just got it wrong and I apologize.

Verify that your Sql Server is in an Availability Group.
If so, look at the link below that has a very good explanation and the solution for the case.

Cannot open database ‘DB’ version 782

If this answer has helped you, mark it helpful so that someone else with a question or similar problem can find an answer or help more easily. Jefferson Clyton Pereira da Silva - [MCSA | MCP | MCTS | MTA | Database Analyst - Sql Server and Oracle]


Wednesday, October 30, 2019 10:02 PM

SQL Server database is not in any availability group, it is a standalone database.


Wednesday, October 30, 2019 10:04 PM

After re-trying the same operation again, the DB internal version got upgraded from 782 to 852 and database was brought online but when we issues any simple SELECT query against database - it resulted with below error and the DB status is not active.

<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000} span.s1 {font-variant-ligatures: no-common-ligatures} </style>

Connection Timeout Expired.  The timeout period elapsed during the post-login phase.  The connection could have timed out while waiting for server to complete the login process and respond; Or it could have timed out while attempting to create multiple active connections.  The duration spent while attempting to connect to this server was - [Pre-Login] initialization=5; handshake=13; [Login] initialization=0; authentication=2; [Post-Login] complete=14731


Wednesday, October 30, 2019 10:06 PM

Just re-tried the restore again and now it's again failing while trying to upgrade internal Db version from 782 to 852. Failed with below error message.

cannot open database version 782. upgrade the database to the latest version


Wednesday, October 30, 2019 10:42 PM | 2 votes

Did you check the SQL Server errorlog for messages? Sounds like there are problems in the database (i.e. corruption) which causes the upgrade step to fail.

I think you should restore the backup on an SQL 2014 instance and run DBCC on it.

Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se


Thursday, October 31, 2019 3:32 AM

Did you check the SQL Server errorlog for messages? Sounds like there are problems in the database (i.e. corruption) which causes the upgrade step to fail.

I think you should restore the backup on an SQL 2014 instance and run DBCC on it.

Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

This is an excellent suggestion.

22 years of database experience, most with SQL Server. Please 'Mark as answered' those posts that helped you.


Thursday, October 31, 2019 6:16 AM

Hi AnkurSqlServer,

Could you please share us the detailed error message which is located at Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Log\ERRORLOG about your issue?

Can you use the following command to view the version and status of the database?

SELECT sys.sysdatabases.name, version,state

FROM sys.sysdatabases join sys.databases on sys.sysdatabases.name=sys.databases.name

where sys.sysdatabases.name='databasename'

This may be a problem in the database itself, and you could try the method suggested by Erland.

Best Regards,

Amelia Gu

MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


Tuesday, November 5, 2019 10:57 AM

check sys.sysdatabases using below
SELECT name, version FROM sys.sysdatabases

share the output screenshot. 


Tuesday, November 5, 2019 1:27 PM

That error indicates you are trying to downgrade the version, not upgrade. 

Please post the results of SELECT @@VERSION from the server you are trying to restore the backup onto.