This entry was posted on Monday, May 23rd, 2005 at 11:47 am and is filed under General, Tech data. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.
Detaching a database is always been a sour spot every company since the beginning of time, when whole tribes of cavemen would fight bloody wars over wether to use Enterprise Manager or Type it into Query Analyzer. Well, ever since the invention of the spear, the Enterprise Manager side have been dominating the argument so I just like too insert my Pro Query Analyzer Propergander:
Query Analyzer allows you to write scripts , so you don`t thave to do all that slow click, wait, click wait, rubbish. Yes admittable it requires you to perpare a script, but hay I`m here to make it simple for you.
This is all you need to type:
USE master
Execute sp_detach_db @dbname = [dbname]
Then just repeat the last line for each database you want to detach. It that simple*
*unless anyone is logged in then it becomes vastly more complicated, but don`t mention that to anyone with a pointed stick. See Killing process off in TSQL, Query Analyzer incredible over complicated answer to it.