Attaching SQL Databases
10:43 am in database by Matt Jenkins
In MSSQL2k, a lot of users would use the detach command within the GUI to kill all the active processes on a DB, this functionality is somewhat cut down in MSSQL2005 – you can see the processes & kill them individually, but not as a bulk kill.
To detach a database in Tsql, you can use:
EXEC sp_detach_db 'database', 'true'
This will detach the DB and skip checks on doing so.