Thursday, August 22, 2019

Detach and Attach SQL Server Database

Detach and Attach SQL Server Database

how to Detach and Attach SQL Server Database using SQL Server Management studio?

First,


According to the above, picture Detach your Selected database.
Next,

According to the above, picture Select "Update Stats" And Select "OK".
Next,
Move Database File Old Location to New location,
Ex: C:\databaseusergroup.mdf to D:\databaseusergroup.mdf
And Next Select "Attach" like Following Picture,


Next,
Attach Database like Following Pictures,
(If You Have multiple data file then you need to select only main MDF file)

Cheers...
and Most welcome your comments and ideas...