Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a way of telling which version of Microsoft SQL Server a database backup is from without restoring it?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

RESTORE HEADERONLY FROM DISK = 'pathTobackupFile'

The database version can be found in the column: DatabaseVersion

From Jonathan Kehayias blog post here the number in this column:

  • SQL Server 7.0 databases have version number 515
  • SQL Server 2000 databases have version number 539
  • SQL Server 2005 databases have version number 611/612
  • SQL Server 2008 databases have version number 655
  • SQL Server 2008R2 databases have version number 661
  • SQL Server 2012 databases have version number 706

If you try to run this sql for a more recent database version than the one you're running it under (eg a 2012 DB from SSMS 2008), the database results display as INCOMPLETE

To check the build number of the instance check for columns:

  • SoftwareVersionMajor
  • SoftwareVersionMinor
  • SoftwareVersionBuild

Documentation can be found here (TechNet link).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.