Auto Add

Thursday, 20 June 2013

Detaching and attaching SQL Server databases



Day -3
Detaching and attaching SQL Server databases



 There are currently two ways to attach a database to and one way to detach a database from an instance of SQL Server. To attach a database, you use sp_attach or CREATE DATABASE specifying the FOR ATTACH argument. As a result, it is recommended that you use only the CREATE DATABASE option when attaching databases.

  

  1.   Expand the Databases folder
  2.   Right-click the thigalla database
  3.   IN Tasks Select Detach option.
  4.   In the Detach Database dialog box, check the boxes in the Drop Connections and Update Statistics columns, Click OK.





Now that the database is detached, you can copy the files to the new storage location and attach

The database to a new instance of SQL Server.

Attach a SQL Server database using SSMS



  1. Expand the server node.
  2. Right-click the Databases folder
  3. Click Attach.
  4. Click the Add button.
  5. In the Locate Database Files dialog box, expand the folder labeled C.
  6. Locate and expand the SQLData folder, and then select the Thigalla.mdf file, click OK.







Note:- You can grant users permissions to schemas.



Thanks & Regards  
Srikanth Goud Virtualization Administrator



No comments:

Post a Comment

Microsoft Intune, a Compliance Policy

  In Microsoft Intune, a Compliance Policy is a set of rules and settings that a device must meet to be considered "healthy" and ...