tags:

views:

16

answers:

2

Hello all,

I have created a database "test" with some tables in MS SQL Server 2008 R2 (i.e. MS SQL Server Management Studio).

Now, I need to export this database as a MDF file.

What should I do?

Thank you

+2  A: 

If you mean that you want to be able to attach the database on another server, then this is what you can do:

  1. detach the database (right click the database and click Detach)
  2. copy the mdf and ldf files to your backup location
  3. attach the database (right click Databases and click Attach)
Gabriel McAdams
Where I can find the MDF? Thank you
q0987
In Management Studio, right click the database and click Properties. Go to the `Files` page. You'll find the location under `Path`.
Gabriel McAdams
A: 

right-click on database from Management Studio -> Detach. Then you have the MDF file you can export to wherever you want :)

danielovich