Database Created Version or Internal Database Version – dbi_createversion

Internal Database Version

Sometimes you will see references to a database with a version of 611 or 655 or similar. These numbers refer to the internal database version and have little meaning at first glance, however with a lookup list you can easily tie them to their parent SQL Server version.

Here is an example looking at the original database created version and the current version of the database. This is useful to show that a database has been upgraded from SQL 2000 to SQL 2005 for example.

--http://jongurgul.com/blog/database-created-version-internal-database-version-dbi_createversion/
--http://connect.microsoft.com/SQLServer/feedback/details/640864/smo-property-database-version-does-not-return-the-version-used-to-create-the-database-but-the-version-that-is-has-been-upgraded-to-on-the-current-instance
DECLARE @DBINFO TABLE ([ParentObject] VARCHAR(60),[Object] VARCHAR(60),[Field] VARCHAR(30),[VALUE] VARCHAR(4000))
INSERT INTO @DBINFO
EXECUTE sp_executesql N'DBCC DBINFO WITH TABLERESULTS'
SELECT [Field]
,[VALUE]
,CASE
WHEN [VALUE] = 515 THEN 'SQL 7'
WHEN [VALUE] = 539 THEN 'SQL 2000'
WHEN [VALUE] IN (611,612) THEN 'SQL 2005'
WHEN [VALUE] = 655 THEN 'SQL 2008'
WHEN [VALUE] = 661 THEN 'SQL 2008R2'
WHEN [VALUE] = 706 THEN 'SQL 2012'
WHEN [VALUE] = 782 THEN 'SQL 2014'
WHEN [VALUE] = 852 THEN 'SQL 2016'
ELSE '?'
END [SQLVersion]
FROM @DBINFO
WHERE [Field] IN ('dbi_createversion','dbi_version')

Source for Database Version Numbers


Comments

Leave a Reply

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