You want to give your database to your friend. So, you want to detach database before copying. Then Here is a little help for you on how can you detach database from SQL Server.
Note: You need exclusive access to your database to attach and their should not be any open connection to your database you want to detach. If the database is in use i.e there is any open connection to your database, then you can restrict access of your database to Single User and it will close all the open connections forcefully. If you don’t know how to do this, you can read my another article on how to restrict access to database to a Single User.
Instructions:
- Open your SQL Server Management Studio and Log In to your User Account.
- In the Object Explorer, Expand the list of databases you currently have in your Server.
- Right Click on the database you want to detach.
- Choose Task->Detach from the Right Click context menu.
- The Detach Database dialogue shows a grid having name of your database in the first row which you are going to detach. So you must check that, you are detaching a correct database.
- By default, the detach operation retains any out-of-date optimization statistics while detaching database. To update the existing optimization statistics, click the Update Statistics check box which is available next to the name of your database in the grid in Detach Database dialogue.
- The Status column shows the state of your database that either it is ready to detach or not. If it is not ready then the Message column shows a linked information about your database. You can click on the hyperlink to obtain additional information.
- When you are ready, click on OK to detach your database.
- You have to refresh the databases list in the Object Explorer to see the changes.
Incoming search terms:
- ms sql database status not ready (1)