Is it possible to run a mdf database without SQL Server
I deployed a setup of windows application which have a .mdf database file included with this setup. I want to install it to another machine where I don't want to install sql server. Is it possible to run the application?
October 6th, 2014 4:11am

You cannot open and read contents of mdf file without attaching it to SQL Server.
Free Windows Admin Tool Kit Click here and download it now
October 6th, 2014 4:40am

Hi Santosh,

According to your description, you want to deploy an application including a mdf file without installing SQL Server in another machine.

Every database has three types of files: primary data files, secondary data files and transaction log files. The primary data file contains the startup information for the database and points to the other files in the database. User data and objects can be stored in this file or in secondary data files. Every database has one primary data file. The recommended file name extension for primary data files is .mdf. For more information, please refer to this link: http://msdn.microsoft.com/en-us/library/ms189563.aspx.

When we want to open and read a mdf file, we should attach it to SQL Server, just as Shanky_621 mentioned. The important thing is that you should find out the mdf file is created by which version of SQL Server. Usually, its not possible to attach a mdf file from higher version to lower version because of compatibility problem. If you really want to do so , you can generate scripts of SSMS then to use SSIS. For more information, please refer to this link: http://www.mssqltips.com/sqlservertip/2810/how-to-migrate-a-sql-server-database-to-a-lower-version/.

If you have any questions, please feel free to ask.

 
Best regards,
Qiuyun Yu

October 7th, 2014 2:28am

mdf is actually the primary datafile for a sqlserver database. its contents can only be  read from once attached to sqlserver instance
Free Windows Admin Tool Kit Click here and download it now
October 7th, 2014 2:32am

Shanky_621 is right, only a attached .mdf file can be accessed.
October 7th, 2014 2:38am

If database was cleanly shutdown then you might want to follow

http://msdn.microsoft.com/en-us/library/ms174385.aspx

Free Windows Admin Tool Kit Click here and download it now
October 7th, 2014 2:47am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics