2013-06-06

How to find the MSSQL version in a backup file

Okay, so I had this SQL dump, but no idea which Microsoft SQL server version it came from.
It's not that difficult to make a good guess though; In the file it shows the original database paths. If you're lucky, you didn't completely change the instance's folders and your instance folder is named somewhat like these.
  • SQL Server 2005 uses MSSQL.<n> (counting up, starting at 1, n+1)
  • SQL Server 2008 uses MSSQL10.<INSTANCENAME>
  • SQL Server 2008R2 uses MSSQL10_50.<INSTANCENAME>
So, open the SQL backup file in a text editor of your choice and search for .mdf. That should put you at the end of the path you need. Just check the path against the list above.