SQL - How to backup a database and export as a MDF file with MS SQL 2008 R2

后端 未结 8 1610
故里飘歌
故里飘歌 2021-02-01 16:24

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.

8条回答
  •  攒了一身酷
    2021-02-01 16:38

    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)

    This is the path where you will find MDF file:

    C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\
    

提交回复
热议问题