Check Internal Version of a .MDF File


When you have a detached .MDF file, you want to check the version number without modifying it. You can use a powershell script as below.
If you want to use the same script for a live database file, you need to take the database offline first.

  
  
 
 
 get-content -Encoding Byte "E:\MSSQL\testcs.mdf" | select-object -skip 0x12064 -first 2
84
3

PS H:> 3*256+64
852
## SQL Server 2016 SP1
 
 
 

 

http://rusanu.com/2011/04/04/how-to-determine-the-database-version-of-an-mdf-file/

Advertisements

One Comment on “Check Internal Version of a .MDF File”

  1. […] wird ein kleiner Aufruf in Powershell beschrieben: https://jingyangli.wordpress.com/2017/04/12/check-internal-version-of-a-mdf-file/. Die tiefergehende Erläuterung findet sich hier: […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s