Restoring database from .mdf and .ldf files of SQL Server 2008

前端 未结 6 1652
天涯浪人
天涯浪人 2020-11-30 23:51

For some reason I have to uninstall SQL Server 2008 R2 but before that I copied two files (.mdf and .ldf) of my database from

<
6条回答
  •  死守一世寂寞
    2020-12-01 00:50

    this is what i did

    first execute create database x. x is the name of your old database eg the name of the mdf.

    Then open sql sever configration and stop the sql sever.

    There after browse to the location of your new created database it should be under program file, in my case is

    C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQL\MSSQL\DATA
    

    and repleace the new created mdf and Idf with the old files/database.

    then simply restart the sql server and walla :)

提交回复
热议问题