Home » SQL Server Error : 948, Severity: 20. The database ‘%.*ls’ cannot be opened be

SQL Server Error : 948, Severity: 20. The database ‘%.*ls’ cannot be opened be

  • by

SQL Server Error : 948 Details


SQL Server Error: 948
Severity: 20
Event Logged or not: Yes
Description:
The database ‘%.*ls’ cannot be opened because it is version %d. This server supports version %d and earlier. A downgrade path is not supported.
Severity 20 Description:
Indicates that a statement has encountered a problem. Because the problem has affected only the current task, it is unlikely that the database itself has been damaged.

Msg 1813, Level 16, State 2, Line 4
Could not open new database ‘Database’. CREATE DATABASE is aborted.
Msg 948, Level 20, State 1, Line 4
The database ‘Database’ cannot be opened because it is version 869. This server supports version 852 and earlier. A downgrade path is not supported.

For example in simple words say

You are trying to restore/attach database/backup which been created with SQL Server 2008, but the actual version of SQL Server you are trying to attach it to is SQL Server 2005.

Now, how to fix microsoft sql server error 948 or how to solve microsoft sql server error 948? Keep reading…

 

Reading sql server error log location from SQL Query

Identifying SQL Server Error Log File used by SQL Server Database Engine can be done by reading SQL Server Error Logs. DBA can execute the XP_READERRORLOG extended stored procedure to read the SQL Server Error Log and search for its location used by the instance of SQL Server.

USE master
Go
xp_readerrorlog 0, 1, N'Logging SQL Server messages in file', NULL, NULL, N'asc'
Go

The parameters for XP_READERRRORLOG are:
1. Value of error log file we would like to read. values are 0 = current, 1 = last one before current, 2 = second last before current etc…
2. Log file type:- 1 or NULL = error log, 2 = SQL Agent log
3. Search string 1:- String one you want to search for
4. Search string 2:- String two you want to search for to further refine the results
5. start time for Search
6. end time for search
7. Sort order for search results:- N’asc’ = ascending, N’desc’ = descending

By default, we have 6 Server Error Logs kept but we can increase the number of SQL Server Error Logs from the default value of six.

For other ways to read and find error log location please our artcile https://sqlserver-dba.co.uk/error-log/sql-server-identify-location-of-the-sql-server-error-log-file.html

Solution for Resolving the Error

This error is expected when we try to attach file from higher version of SQL Server to lower version of SQL. We cannot attach/detach or backup/restore a database from a newer version of SQL Server down to an older version. This is because they have a different internal file structures which does not support backwards compatibility.

Here is what I was able to find on the internet.

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

For more build details go to “https://sqlserverbuilds.blogspot.com/2014/01/sql-server-internal-database-versions.html”

For example in simple words say:

You are trying to restore/attach database/backup which been created with SQL Server 2008, but the actual version of SQL Server you are trying to attach it to is SQL Server 2005.

Here solution would be  : you are trying to attach a 2008 Database (655) to a 2005 instance (611); that cannot work, obviously. so solutions are:

– either update your 2005 instance to a 2008 one

– or install another instance on the same server (a 2008 one)

– or use any other server which has 2008 already installed.

 

Additional information:

SQL server error 948 can occur in different versions 

  1. in sql 2008 r2 error is ” sql server error 948 version 661
  2. error 948 in sql server 2008 r2
  3. in sql 2016 error is ” sql server error 948 version 852 “
  4. in sql 2012 error is ” sql server error 948 version 706 “
  5. in sql 2017 error is “ sql server error 948 version 869
  6. or simply like ” microsoft sql server 2008 r2 error 948
  7. sql server 2012 error 948,
  8. sql server 2005 error 948,

SQL Server Error Code and solution summary


SQL Server Error: 948
Severity: 20
Event Logged or not: Yes
Description:
The database ‘%.*ls’ cannot be opened because it is version %d. This server supports version %d and earlier. A downgrade path is not supported.

In short microsoft sql server error 948 solution would be to make sure database which is to be restored is of same version or lower  version than SQL Server we are trying to restore.

Leave a Reply

Your email address will not be published. Required fields are marked *