Detach Database
How to Detach a Database in SQL Server Management Studio?
· User can Detach a Database in the SQL server that will remove the Database from the list of Databases.
· Open SQL Server Management Studio --> File --> Connect Object Explorer.
Create New Database.
· To detach any Database, let's create a new database to illustrate the process.
· Right-click on Databases and click on New Database.
Enter the Database name as NewDatabase and click Add.
· The new database will create and appear under Databases.
Detach Database
· Right-click on the Database that has to be Detached. Go to Tasks and select Detach.
· There are two checkboxes in the new tab.
-
Drop Connections – The server will drop all the connections with the Database selected.
-
Update Statistics – It will update the statistics once the Database is detached.
· Click Ok once when the changes are made.
· NewDatabase will be detached from the Databases.