<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; 2005 Take Off Line or Detach Database</title>
	<atom:link href="http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Thu, 23 May 2013 14:22:59 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #026 &#124; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-464688</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #026 &#124; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 27 Apr 2013 01:31:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-464688</guid>
		<description><![CDATA[[...] Take Off Line or Detach Database Using the alter database statement (SQL Server 2k and beyond) is the preferred method. The rollback after statement will force currently executing statements to rollback after N seconds. [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Take Off Line or Detach Database Using the alter database statement (SQL Server 2k and beyond) is the preferred method. The rollback after statement will force currently executing statements to rollback after N seconds. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fabian AM</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-351462</link>
		<dc:creator><![CDATA[Fabian AM]]></dc:creator>
		<pubDate>Thu, 20 Sep 2012 16:54:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-351462</guid>
		<description><![CDATA[Thanks, excellent!!]]></description>
		<content:encoded><![CDATA[<p>Thanks, excellent!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-308441</link>
		<dc:creator><![CDATA[Karl]]></dc:creator>
		<pubDate>Mon, 02 Jul 2012 10:56:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-308441</guid>
		<description><![CDATA[Does anyone know what options are used if you use the UI to take the DB offline?]]></description>
		<content:encoded><![CDATA[<p>Does anyone know what options are used if you use the UI to take the DB offline?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niels Brinch</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-303939</link>
		<dc:creator><![CDATA[Niels Brinch]]></dc:creator>
		<pubDate>Thu, 21 Jun 2012 12:49:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-303939</guid>
		<description><![CDATA[Great little post. I find myself coming back here every time I need to take a database offline :)]]></description>
		<content:encoded><![CDATA[<p>Great little post. I find myself coming back here every time I need to take a database offline :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pandian</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-285167</link>
		<dc:creator><![CDATA[Pandian]]></dc:creator>
		<pubDate>Wed, 16 May 2012 15:46:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-285167</guid>
		<description><![CDATA[Good One. Thanks for this. It helped to turn off the junk databases.]]></description>
		<content:encoded><![CDATA[<p>Good One. Thanks for this. It helped to turn off the junk databases.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jill J.</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-269431</link>
		<dc:creator><![CDATA[Jill J.]]></dc:creator>
		<pubDate>Thu, 29 Mar 2012 14:36:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-269431</guid>
		<description><![CDATA[If I take a SQL Server 2000 db offline with the ALTER cmd, can I then put it back online with another ALTER cmd?   Or since it&#039;s already offline... how can I access it, to put it back online????]]></description>
		<content:encoded><![CDATA[<p>If I take a SQL Server 2000 db offline with the ALTER cmd, can I then put it back online with another ALTER cmd?   Or since it&#8217;s already offline&#8230; how can I access it, to put it back online????</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-109572</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 05 Jan 2011 13:40:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-109572</guid>
		<description><![CDATA[Post the update code that you used]]></description>
		<content:encoded><![CDATA[<p>Post the update code that you used</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Falguni</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-109398</link>
		<dc:creator><![CDATA[Falguni]]></dc:creator>
		<pubDate>Tue, 04 Jan 2011 05:13:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-109398</guid>
		<description><![CDATA[Hi,

        I have a problem. There is a table in my database called Corporates. It has a Field which contains the Domain name. 

When i open the site the URL of the Site is fetched from the Domain Name field of the Table. I need to update the Domain Name field for testing purpose with Localhost. After testing when i again Update the Domain Name field with the Original Domain Name of the Site it automatically get updated to LocalHost. 

I checked the code to see if it has been coded to update but to no avail. I dont understand why is this happening. I need to solve this problem urgently. Any help is greatly appreciated.]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>        I have a problem. There is a table in my database called Corporates. It has a Field which contains the Domain name. </p>
<p>When i open the site the URL of the Site is fetched from the Domain Name field of the Table. I need to update the Domain Name field for testing purpose with Localhost. After testing when i again Update the Domain Name field with the Original Domain Name of the Site it automatically get updated to LocalHost. </p>
<p>I checked the code to see if it has been coded to update but to no avail. I dont understand why is this happening. I need to solve this problem urgently. Any help is greatly appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ssysadmin</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-83651</link>
		<dc:creator><![CDATA[ssysadmin]]></dc:creator>
		<pubDate>Tue, 10 Aug 2010 22:29:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-83651</guid>
		<description><![CDATA[Can you help me to attach databases in bulk, i.e. if there are 100 databases and I’m needed to migrate in bulk to other server through script?
Currently I hosted databases on SQL Server 2005 SP2 x64 bit. I&#039;m planning to upgrade my database server to SQL Server 2008 R2 x64, and it&#039;s not supported to upgrade SQL Server 2008 R2 X64 from SQL Server 2005 x64 SP2 (according to http://msdn.microsoft.com/en-us/library/ms143393.aspx).

what is your suggestion?
I am planning to install new version of SQL Server 2008 Rs x64 and migrate all databases to new instance, that is why I am looking for script for attaching SQL Server in bulk.

Thank you.]]></description>
		<content:encoded><![CDATA[<p>Can you help me to attach databases in bulk, i.e. if there are 100 databases and I’m needed to migrate in bulk to other server through script?<br />
Currently I hosted databases on SQL Server 2005 SP2 x64 bit. I&#8217;m planning to upgrade my database server to SQL Server 2008 R2 x64, and it&#8217;s not supported to upgrade SQL Server 2008 R2 X64 from SQL Server 2005 x64 SP2 (according to <a href="http://msdn.microsoft.com/en-us/library/ms143393.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms143393.aspx</a>).</p>
<p>what is your suggestion?<br />
I am planning to install new version of SQL Server 2008 Rs x64 and migrate all databases to new instance, that is why I am looking for script for attaching SQL Server in bulk.</p>
<p>Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Altax</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-82346</link>
		<dc:creator><![CDATA[Altax]]></dc:creator>
		<pubDate>Fri, 30 Jul 2010 11:27:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-82346</guid>
		<description><![CDATA[Thanks for the information. That was a great post.]]></description>
		<content:encoded><![CDATA[<p>Thanks for the information. That was a great post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Himanshu</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-80102</link>
		<dc:creator><![CDATA[Himanshu]]></dc:creator>
		<pubDate>Tue, 13 Jul 2010 16:14:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-80102</guid>
		<description><![CDATA[Hi..

I have an issue, Actually my all tables have schema user. and all tables are looks like user.tablname. Now if i restore this backup into new server then I am unable to create database user &quot;user&quot; because it shows error user already exits. And if I create another user then I unable to access table by just its name (I can access by schemaname.tablename) , I want to change schema of all tables at once . Please help me regarding this.

Himanshu Kumar Pant
for eWebGuru.com]]></description>
		<content:encoded><![CDATA[<p>Hi..</p>
<p>I have an issue, Actually my all tables have schema user. and all tables are looks like user.tablname. Now if i restore this backup into new server then I am unable to create database user &#8220;user&#8221; because it shows error user already exits. And if I create another user then I unable to access table by just its name (I can access by schemaname.tablename) , I want to change schema of all tables at once . Please help me regarding this.</p>
<p>Himanshu Kumar Pant<br />
for eWebGuru.com</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER – T-SQL Script to Take Database Offline – Take Database Online Journey to SQL Authority with Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-66561</link>
		<dc:creator><![CDATA[SQL SERVER – T-SQL Script to Take Database Offline – Take Database Online Journey to SQL Authority with Pinal Dave]]></dc:creator>
		<pubDate>Sat, 24 Apr 2010 01:31:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-66561</guid>
		<description><![CDATA[[...] 24, 2010 by pinaldave    Blog reader Joyesh Mitra recently left a comment to one of my very old posts about SQL SERVER – 2005 Take Off Line or [...]]]></description>
		<content:encoded><![CDATA[<p>[...] 24, 2010 by pinaldave    Blog reader Joyesh Mitra recently left a comment to one of my very old posts about SQL SERVER – 2005 Take Off Line or [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joyesh Mitra</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-65918</link>
		<dc:creator><![CDATA[Joyesh Mitra]]></dc:creator>
		<pubDate>Wed, 21 Apr 2010 12:23:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-65918</guid>
		<description><![CDATA[How to take database online. this is urgent. I can not find in your blog]]></description>
		<content:encoded><![CDATA[<p>How to take database online. this is urgent. I can not find in your blog</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shafi</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-58056</link>
		<dc:creator><![CDATA[Shafi]]></dc:creator>
		<pubDate>Tue, 01 Dec 2009 08:30:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-58056</guid>
		<description><![CDATA[I assume using the command -

ALTER DATABASE [mydb] SET OFFLINE WITH
ROLLBACK AFTER 30 SECONDS

will close the existing connections as I want to restore my DB and restore command fails with 

&quot;Exclusive access could not be obtained because the database is in use.&quot;

Any help will be appreciated.
Thanks]]></description>
		<content:encoded><![CDATA[<p>I assume using the command -</p>
<p>ALTER DATABASE [mydb] SET OFFLINE WITH<br />
ROLLBACK AFTER 30 SECONDS</p>
<p>will close the existing connections as I want to restore my DB and restore command fails with </p>
<p>&#8220;Exclusive access could not be obtained because the database is in use.&#8221;</p>
<p>Any help will be appreciated.<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: riyo</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-56720</link>
		<dc:creator><![CDATA[riyo]]></dc:creator>
		<pubDate>Thu, 15 Oct 2009 09:22:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-56720</guid>
		<description><![CDATA[I tried to Drop database from web page, by executing SQL Command, then show the result, done or error. And I got this message : Cannot drop database &quot;detach&quot; because it is currently in use.

Thanks for your help.]]></description>
		<content:encoded><![CDATA[<p>I tried to Drop database from web page, by executing SQL Command, then show the result, done or error. And I got this message : Cannot drop database &#8220;detach&#8221; because it is currently in use.</p>
<p>Thanks for your help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jelong</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-48037</link>
		<dc:creator><![CDATA[jelong]]></dc:creator>
		<pubDate>Wed, 04 Mar 2009 19:27:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-48037</guid>
		<description><![CDATA[Carlos,
for SQL Server 6.5, you can use sp_dboption dbname, offline, true]]></description>
		<content:encoded><![CDATA[<p>Carlos,<br />
for SQL Server 6.5, you can use sp_dboption dbname, offline, true</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: komninos</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-47157</link>
		<dc:creator><![CDATA[komninos]]></dc:creator>
		<pubDate>Tue, 24 Feb 2009 07:25:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-47157</guid>
		<description><![CDATA[i want to know how i can create an offline server to play for example Lineage-i own sql and navicat]]></description>
		<content:encoded><![CDATA[<p>i want to know how i can create an offline server to play for example Lineage-i own sql and navicat</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: komninos</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-47156</link>
		<dc:creator><![CDATA[komninos]]></dc:creator>
		<pubDate>Tue, 24 Feb 2009 07:23:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-47156</guid>
		<description><![CDATA[hi i want to know how i can create an offline server to play for example Lineage-i own SQL and navicat]]></description>
		<content:encoded><![CDATA[<p>hi i want to know how i can create an offline server to play for example Lineage-i own SQL and navicat</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fabio</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-44696</link>
		<dc:creator><![CDATA[Fabio]]></dc:creator>
		<pubDate>Wed, 10 Dec 2008 16:21:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-44696</guid>
		<description><![CDATA[Hello,
does a offline database uses less memory ?]]></description>
		<content:encoded><![CDATA[<p>Hello,<br />
does a offline database uses less memory ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dinesh</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-43771</link>
		<dc:creator><![CDATA[Dinesh]]></dc:creator>
		<pubDate>Fri, 17 Oct 2008 11:44:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-43771</guid>
		<description><![CDATA[Hi Pinal,

1.Can we shrink the log file after taking database into offline?]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,</p>
<p>1.Can we shrink the log file after taking database into offline?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Loh</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-39943</link>
		<dc:creator><![CDATA[Andy Loh]]></dc:creator>
		<pubDate>Wed, 09 Jul 2008 05:36:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-39943</guid>
		<description><![CDATA[how to shrink transaction loh in sql 2005.]]></description>
		<content:encoded><![CDATA[<p>how to shrink transaction loh in sql 2005.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Harinath_hyd</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-35803</link>
		<dc:creator><![CDATA[Harinath_hyd]]></dc:creator>
		<pubDate>Mon, 28 Apr 2008 05:27:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-35803</guid>
		<description><![CDATA[Hi dave
i want to lock the record and send the message to user who try to access the same record for certain time
can u help me out .]]></description>
		<content:encoded><![CDATA[<p>Hi dave<br />
i want to lock the record and send the message to user who try to access the same record for certain time<br />
can u help me out .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: RichSeattle</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-35526</link>
		<dc:creator><![CDATA[RichSeattle]]></dc:creator>
		<pubDate>Thu, 24 Apr 2008 23:50:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-35526</guid>
		<description><![CDATA[Magnus,  sure it can.  A quick way to do this is simply to use a cursor and a query similar to -

select name from sysdatabases where name not in (&#039;master&#039;, &#039;msdb&#039;, &#039;model&#039;,  &#039;tempdb&#039;, &#039;donttakeoffline&#039;)

*note &#039;donttakeoffline&#039; is the name of a db you might want to exclude, the others you shot NOT take offline)

Have the cursor dynamically build the command and exec such as this - 

set @cmd = &#039;Alter database &#039; + @dbname + &#039; set offline with rollback immediate&#039;
exec (@cmd)


If you want to exclude them you can exclude from the original query for the cursor or use an IF statement example   

If @dbname != &#039;dontoffline&#039; 
begin
exec @cmd
else
end


Mind you, doing this can be dangerous and is not 100% certain.  Most things like this should be done one at a time and/or monitored very closely.

If I were going to do this, I would have it record into a table somewhere of the status of taking it offline and when it was taken offline for each DB.

*not responsible for people breaking their DB using this information*]]></description>
		<content:encoded><![CDATA[<p>Magnus,  sure it can.  A quick way to do this is simply to use a cursor and a query similar to -</p>
<p>select name from sysdatabases where name not in (&#8216;master&#8217;, &#8216;msdb&#8217;, &#8216;model&#8217;,  &#8216;tempdb&#8217;, &#8216;donttakeoffline&#8217;)</p>
<p>*note &#8216;donttakeoffline&#8217; is the name of a db you might want to exclude, the others you shot NOT take offline)</p>
<p>Have the cursor dynamically build the command and exec such as this &#8211; </p>
<p>set @cmd = &#8216;Alter database &#8216; + @dbname + &#8216; set offline with rollback immediate&#8217;<br />
exec (@cmd)</p>
<p>If you want to exclude them you can exclude from the original query for the cursor or use an IF statement example   </p>
<p>If @dbname != &#8216;dontoffline&#8217;<br />
begin<br />
exec @cmd<br />
else<br />
end</p>
<p>Mind you, doing this can be dangerous and is not 100% certain.  Most things like this should be done one at a time and/or monitored very closely.</p>
<p>If I were going to do this, I would have it record into a table somewhere of the status of taking it offline and when it was taken offline for each DB.</p>
<p>*not responsible for people breaking their DB using this information*</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Magnus</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-33795</link>
		<dc:creator><![CDATA[Magnus]]></dc:creator>
		<pubDate>Sat, 16 Feb 2008 22:58:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-33795</guid>
		<description><![CDATA[Hi  Dave!

ALTER DATABASE [mydb] SET OFFLINE WITH ROLLBACK IMMEDIATE

Works just fine but if I want to take many DBs (354) offline with a script at the same time. Can  that  be done. I also what to exclude some DBs from beeing taken offline.

/Magnus]]></description>
		<content:encoded><![CDATA[<p>Hi  Dave!</p>
<p>ALTER DATABASE [mydb] SET OFFLINE WITH ROLLBACK IMMEDIATE</p>
<p>Works just fine but if I want to take many DBs (354) offline with a script at the same time. Can  that  be done. I also what to exclude some DBs from beeing taken offline.</p>
<p>/Magnus</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carlos</title>
		<link>http://blog.sqlauthority.com/2007/04/25/sql-server-2005-take-off-line-or-detach-database/#comment-15983</link>
		<dc:creator><![CDATA[Carlos]]></dc:creator>
		<pubDate>Sun, 21 Oct 2007 06:14:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/25/take-sql-server-2005-off-line-or-detach-the-database/#comment-15983</guid>
		<description><![CDATA[And SQL sERVER 6.5? wATH]]></description>
		<content:encoded><![CDATA[<p>And SQL sERVER 6.5? wATH</p>
]]></content:encoded>
	</item>
</channel>
</rss>