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

后端 未结 8 1743
故里飘歌
故里飘歌 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:37

    In my experience, its easier to use the commands sp_detach_db (MSDN) and sp_attach_db (MSDN). I was trying to attach a database that was offline when detached and SQL Server Management Studio (2014) kept crashing when I used the Attach option from the right-click context menu. The commands worked - hope this saves someone some time.

    NOTE: Run SSMS as an administrator if you see an access denied while trying to execute the attach command

提交回复
热议问题