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

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


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

  1. […] wird ein kleiner Aufruf in Powershell beschrieben: Die tiefergehende Erläuterung findet sich hier: […]

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s