Quantcast
Viewing all articles
Browse latest Browse all 7696

How to determine SQL Server version of an .mdf file?

Hi,

 

I'm looking for a way to determine (in .NET code) whether an .mdf file is in SQL Server 2005 or SQL Server 2008 format, *without* modifying the file.

 

The previous version of our application used SQL Server 2005 (Express) .mdf files as its file format. The next version will use SQL Server 2008 (Express) .mdf files. When users attempt to open an .mdf file in our application, we need to be able to tell what version it is, without modifying the file.

 

If I try to attach to an .mdf file from SQL Server 2008, it *upgrades* the database to SQL Server 2008 format, which is not what I'm looking for. And I don't want to have to make a temporary copy of the .mdf file either in order to do this check, as the files can be quite large.

 

Any suggestions?

 

cheers,

 

Marcus

 

 


Viewing all articles
Browse latest Browse all 7696

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>