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.
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.
This article will guide you on how to determine the database #version or build from a #backup file.
To know what #SQL version a #database is:
The first is by using either Enterprise Manager or SQL Server Management Studio and right clicking on the instance name and selecting Properties. In the general section you will see information such as on the following screenshots. The "Product version" or "Version" gives you a number of the version that is installed.
In order to find the SQL Server version from a bak file:
1. Here is the output returned by the RESTORE HEADERONLY statement. Here you will see a DatabaseVersion column that contains the value.
2. That's how you find out from which version of SQL Server a given backup file came.