How to detach a database (SQL Server Management Studio)

Source: Internet
Author: User
Tags management studio sql server management sql server management studio

    1. In SQL Server Management Studio Object Explorer, connect to an instance of the SQL Server database engine, and then expand the instance.

    2. Expand Databases, and select the name of the user database that you want to detach.

    3. Detaching a database requires exclusive access to the database. If the database is in use, it is limited to allowing only a single user access:

      • Right-click the database name and point to properties.
      • In the Select a page pane, select Options.
      • In the other Options pane, scroll down to the status option.
      • Select the restrict Access option, and then, in its drop-down list, select Single User.
      • Click OK.
        A message box informs you that this operation will close all connections to the database. To continue, click OK.
    4. Right-click the database name, point to Tasks, and then click Detach. The Detach Database dialog box appears.

    5. The database to detach grid displays the name of the selected database in the database name column. Verify that this is the database that you want to detach.

    6. By default, the detach operation retains outdated optimization statistics when the database is detached, and to update existing optimization statistics, select the UPDATE STATISTICS check box.

    7. By default, the detach operation retains all full-text catalogs associated with the database. To remove the full-text catalog, clear The Keep full-text catalog check box.

    8. The Status column displays the current database state (ready or not ready).

      If the status is not ready, the message column displays hyperlink information about the database. When the database involves replication,the message column is displayed Database replicated . When a database has one or more active connections, themessage column displays the number of < active connections > active connections; For example, an active connection. Before you can detach a data column, you must select the delete connection check box to disconnect the connection to all active connections.

      To get more information about a message, click the hyperlink.

    9. When you are ready to detach the database, click OK. http://technet.microsoft.com/zh-cn/library/ms191491 (v=sql.90)

How to detach a database (SQL Server Management Studio)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.