Are you trying to find the database version or build from a backup file?
This guide will help you.
We often receive the complete details about the database including the supported version of the SQL Server. But what if we don’t receive that information? Well SQL Server does offer a way to determine the version where the files were created.
Here at Ibmi Media, we regularly help our Customers to restore/create a database from bak or MDF and LDF files as part of our Server Management Services.
In this context, we shall look into steps to determine the database version using the backup file.
How to find the database version or build from backup ?
Below is a restore command which returns the metadata about the backup file:
Restore headeronly from disk='physical_backup_device_name'
As a result, of the above command, we get a large set of columns (+50) with greater details of the backup file. But now, we just need the DatabaseVersion column.
For example, to get get more information about the database such as Database Version, Database Creation Date, BackupSize and FirstLSN, you have to run the following command:
Restore headeronly from disk='D:MyBackup_01.bak'
Also, you can find the exact database version via the SQL Server builds. This contains the values of the Internal Database Version column, where you can easily find the SQL Server version where the database was created.