Attach / detach a database


This article demonstrates how to attach or detach a database using SQL commands.

Open the query analyzer and enter one of the following:

To detach the database: sp_detach_db StuckIndoors

To attach a database: sp_attach_single_file_db @dbname = 'StuckIndoors', @physname = 'E:\MSSQLData\data\StuckIndoors.mdf'








Attach / detach a database


Attach / detach a database : Multi-thousand tips to make your life easier.


This article demonstrates how to attach or detach a database using SQL commands.

Open the query analyzer and enter one of the following:

To detach the database: sp_detach_db StuckIndoors

To attach a database: sp_attach_single_file_db @dbname = 'StuckIndoors', @physname = 'E:\MSSQLData\data\StuckIndoors.mdf'

Attach / detach a database

Attach / detach a database : Multi-thousand tips to make your life easier.
Attach / detach a database
Attach / detach a database
Recommend to friends
  • gplus
  • pinterest

Comment

Leave comment

Rating