The Daily Insight

Connected.Informed.Engaged.

general

How to Check SQL Version of bak file

Writer Andrew Davis
How to Check SQL Version of bak file

How to Check SQL Version of bak file 

Silky Terrier Dog Breed Playing Aro... Silky Terrier Dog Breed Playing Around

Before going in-depth about the topic we should start from the initials so the first question that comes to our mind is what a bak file is. 

Silky Terrier Dog Breed Playing Around
What is Bak File Extension? 

Bak is a file extension it represents the backup files of different application that is stored for backup purpose.  

Bak files are usually created and stored automatically. But it can also be executed manually a user can create a bak file if it wants to execute some changes without changing the original file.

What is SQL? 

 SQL stands for Standard Query language, it is a domain-specific language and is usually used in the database management system. 

Most of the SQL servers maintained the full back-up of the files, the SQL servers maintained a complete transaction log so data can easily be recovered. 

How to create a full-back up of the files?

The full backup can be executed in two ways 

  1. T-SQL 
  2. SSMS 

T-SQL (Transact SQL) is a programming extension that is used to add server features to the SQL. The T-SQL is created by Sybase and Microsoft. 

T-SQL is used for full backup, the user can retain the full database exactly it was saved at the time of backup. In T-SQL full backup is executed using at least two parameters (1) the name of the database (2) the backup device.

BACKUP DATABASE [SQLDemo]

To DISK=’C: \PowerSQL\SQLDemo.bak’

WITH FORMAT,

      MEDIANAME = ‘Native_SQLServerBackup’,

      NAME = ‘Full-SQLDemo backup’

IF you wanted to create backup of multiple files 

BACKUP DATABASE ProdSQLDemo 

TO DISK = ‘F: \PowerSQL\ProdSQLDemo_1.BAK’

MIRROR TO DISK = ’F: \PowerSQL\ProdSQLDemo_2.BAK’

MIRROR TO DISK = ’F: \PowerSQL\ProdSQLDemo_3.BAK’

MIRROR TO DISK = ’F: \PowerSQL\ProdSQLDemo_4.BAK’

WITH FORMAT

GO

(2)SSMS 

SSMS stands for SQL Server Management Studio. The storage of bak files in SSMS is considerably easy. SSMS has GUI (Graphic User interface) the storage of files is simple. 

SSMS provides the bak files importing features and files restoration features. 

How to Check SQL version of Bak file 

Have you ever stuck in a situation when where you have to restore or create bak or MDF files for the implementation of new software or application and you did not remember the version of bak files? If your answer is yes or you felt that you are going to face the problem then here we discuss the methods through which you can determine the version of the bak SQL file.

Method#1 

By restoring the header only, the command returns metadata about the backup file. 

The command for the operation  

RESTORE HEADERONLY FROM DISK = ‘device name’

UsernameServerNameDatabaseNameDatabaseVersion
User/PinalUser/ss14SQL Authority782

The database version number can be used to determine the SQL server version. In this example, the version is SQL server 2016. The table is shown below, the output that provides us the SQL server version, internal database version, and compatibility level. 

SQL