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.
- Expand the Databases folder
- Right-click the thigalla database
- IN Tasks Select Detach option.
- 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
- Expand the server node.
- Right-click the Databases folder
- Click Attach.
- Click the Add button.
- In the Locate Database Files dialog box, expand the folder labeled C.
- 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