Skip to main content

Microsoft SQL Server Internal Database Versions and Compatibility Levels

A database created by a more recent version of Microsoft SQL Server cannot be attached or restored to an earlier version. This restriction is there because an older version cannot know about file format changes that were introduced in the newer release.

If you attempt to attach a database to an earlier version, you will get SQL Server error 948 with the internal version numbers listed in the error message text:


-- Attaching SQL2019 database to SQL2017
CREATE DATABASE Database2019
ON (FILENAME = N'C:\SqlServerData\Database2019.mdf'),
   (FILENAME = N'C:\SqlServerData\Database2019_log.ldf')
FOR ATTACH;
Msg 1813, Level 16, State 2, Line 1
Could not open new database 'Database2019'. CREATE DATABASE is aborted.

Msg 948, Level 20, State 1, Line 1
The database 'Database2019' cannot be opened because it is version 904.
This server supports version 869 and earlier. A downgrade path is not supported.

The internal database versions for SQL Server aren't clearly documented in the Microsoft documentation. To get the internal database version, you can use one of the following:

SELECT DATABASEPROPERTYEX(N'YourDatabaseName', 'Version');
-- Column DatabaseVersion
RESTORE HEADERONLY FROM DISK = N'C:\backups\Database.bak';
-- Column status: search "Version="
EXEC sp_helpdb;


SQL Server VersionInternal Database VersionDatabase Compatibility LevelSupported Database Compatibility Levels
SQL Server 2022?160?
SQL Server 2019 CTP 3.2 / RC 1 / RC 1.1 / RTM904150150,140,130,120,110,100
SQL Server 2019 CTP 3.0 / 3.1902150150,140,130,120,110,100
SQL Server 2019 CTP 2.3 / 2.4 / 2.5897150150,140,130,120,110,100
SQL Server 2019 CTP 2.1 / 2.2896150150,140,130,120,110,100
SQL Server 2019 CTP 2.0895150150,140,130,120,110,100
SQL Server 2017868 / 869140140,130,120,110,100
SQL Server 2016852130130,120,110,100
SQL Server 2014782120120,110,100
SQL Server 2012706110110,100,90
SQL Server 2012 CTP1
(a.k.a. SQL Server 2011 Denali)
684110110,100,90
SQL Server 2008 R2660 / 661100100,90,80
SQL Server 2008655100100,90,80
SQL Server 2005 SP2+
with VarDecimal enabled
6129090,80,70
SQL Server 20056119090,80,70
SQL Server 20005398080,70
SQL Server 7.05157070
SQL Server 6.54086565
SQL Server 6.04066060


Legend: ? = still investigating, RTM = Release to manufacturing, SPn = Service Pack n, CTP = Community Technology Preview (beta release).


You can comment here. If you know of a internal DB version that we don't have listed here, please use the comments.

I work on this site continuously and keep the information up to date. If it helps you, you can support me:


FONT: https://sqlserverbuilds.blogspot.com/2014/01/sql-server-internal-database-versions.html





Comments

Most visited posts

Dark theme in foxpro visual

Apply dark theme in visual foxpro editor and also in Notepad++ The editor will look very similar to the microsoft visual studio dark theme. Requires Visual FoxPro 9 with SP2. Colors used in the fonts: FOXPRO LOOK  *| AUTOCOM3 TECNOLOGIA E SOFTWARES LTDA (c) 2018 Todos os direitos reservados. *| *| Data da última revisão deste codigo: 02/10/2019 11:05:49 AM SET PATH TO HOME() + "FFC\" ADDITIVE #include "Registry.H" CLEAR setdarkthemeeditorcolors() MESSAGEBOX([Volte a abrir o visual fox para aplicar o tema.]; , 4096 + 64; , [DarkTheme for Microsoft Visual FoxPro]) FUNCTION setdarkthemeeditorcolors() LOCAL lnloop    AS INTEGER; , lcregkey  AS STRING; , lcvalue   AS STRING; , regconst  AS STRING DIMENSION aeditorcolors[7, 3] aeditorcolors[1, 1] = "EditorCommentColor" aeditorcolors[1, 2] = "RGB(87,166,74,30,30,30), NoAuto, NoAuto" aeditorcolors[2, 1] = "EditorKeywordColor&q

How to change color according to cell value in Visual Foxpro grid.

This post teaches you how to get the effect shown in the image below using the GRID component of visual fox pro. Requires visual foxpro 9.0 SP2 I usually create a class for this, but here in the example I will do it in the simplest way, however, using a method inside the form. You need to create a blank form, add a GRID, a REFRESH button and add a table.  In my example I used a very basic table, called VALORES.DBF, with the VALOR field.  If the value is 1, I use one color, if it is 2, I use another and so on. My VALORES.DBF table is in the same directory where I am saving the FORM.  Creating the table CREATE TABLE values ​​(n(10,2) value) INSERT INTO values ​​(value) VALUES (1) INSERT INTO values ​​(value) VALUES (2) INSERT INTO values ​​(value) VALUES (3)  FORM PROPERTIES BINDCONTROLS = .F. DATASESSION = 1  INIT SELECT values LOCATE THISFORM.BINDCONTROLS = .T.  LOAD METHOD IF NOT FILE('values.dbf') SET MESSAGE TO MESSAGEBOX('Table VALORES.DBF is not available in 

How to deploy a printed pages control in the VFP to take an action after the report prints.

Isolved this issue by creating a public variable: PUBLIC _npagetotal _npagetotal = 0 Then, using the ReportListener component to control the reports, analyze the pagetotal property after the report runs.  If it returns <> 0, it means there was content in the report and if it returns 0 (zero), there was no content. */ control of printed pages _npagetotal = 0 LOCAL loreportlistener loreportlistener = CREATEOBJECT("ReportListener") loreportlistener.LISTENERTYPE = 0 loreportlistener.QUIETMODE = .T. REPORT FORM pathgeral + '\report\danfe_nfce_2.frx' OBJECT loreportlistener        _npagetotal = loreportlistener.pagetotal RELEASE loreportlistener IF _npagetotal<> 0 THEN   * PERFORMS AN ENDIF  ACTION