Attach\Detach in SQL Server database:

Published on by LakshmiSaahul,Dhana Royal

Attach\Detach:

1. Take full database backup before performing activity.

2. After go to SQL Server database> tasks> detach> select drop all connections options

3. Copy files from one location to another location by using copy option but not cut method.

4. After files .mdf, .ldf moved then attach database from management studion

5. After application tests then delete older .mdf and .ldf files from old path or location.


Note: 
1.To perform attach\detach requires database level downtime. 

2.If we perform attach\detach then INDIRECT CHECKPOINT raised by database engine automatically.

3.System databases not possible to attach and detach.


------------------

BACKUP AND RESTORE

ATTACH AND DETACH

WITH MOVE OPTION

COPY DATABASE WIZARD

IMPORT AND EXPORT [ojbect level backup]

Another mothod with in same database to store with different table name with data

:

select * into [ NEW TABLE NAME ] FROM [OLD TABLE NAME]

 

 

Advertising
To be informed of the latest articles, subscribe:
Comment on this post