<?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; ALTER DATABASE dbname SET SINGLE_USER WITH ROLLBACK IMMEDIATE</title>
	<atom:link href="http://blog.sqlauthority.com/2010/02/11/sql-server-alter-database-dbname-set-single_user-with-rollback-immediate/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2010/02/11/sql-server-alter-database-dbname-set-single_user-with-rollback-immediate/</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: phong</title>
		<link>http://blog.sqlauthority.com/2010/02/11/sql-server-alter-database-dbname-set-single_user-with-rollback-immediate/#comment-481109</link>
		<dc:creator><![CDATA[phong]]></dc:creator>
		<pubDate>Thu, 23 May 2013 11:06:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7963#comment-481109</guid>
		<description><![CDATA[hi all ,
in my program, I run two sql scripts by osql.exe. 

Script 1 :
Alter Database [RC_DB_NAME] Set SINGLE_USER with Rollback Immediate
GO
 EXEC dbo.sp_dbcmptlevel @dbname= [RC_DB_NAME], @new_cmptlevel=110
GO
Alter Database [RC_DB_NAME] Set MULTI_USER 
Script 2 :
Select * from Any_Table

Have a error that is catched by sqlexption of .net when run script 2 as follows

System.Data.sqlclient.SqlException: A transport-level error has occurred when sending the request to the server.(Provider :share Memory provider,error:0 - No process is on the other end of the pipe)

Pls help me.]]></description>
		<content:encoded><![CDATA[<p>hi all ,<br />
in my program, I run two sql scripts by osql.exe. </p>
<p>Script 1 :<br />
Alter Database [RC_DB_NAME] Set SINGLE_USER with Rollback Immediate<br />
GO<br />
 EXEC dbo.sp_dbcmptlevel @dbname= [RC_DB_NAME], @new_cmptlevel=110<br />
GO<br />
Alter Database [RC_DB_NAME] Set MULTI_USER<br />
Script 2 :<br />
Select * from Any_Table</p>
<p>Have a error that is catched by sqlexption of .net when run script 2 as follows</p>
<p>System.Data.sqlclient.SqlException: A transport-level error has occurred when sending the request to the server.(Provider :share Memory provider,error:0 &#8211; No process is on the other end of the pipe)</p>
<p>Pls help me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: telluric</title>
		<link>http://blog.sqlauthority.com/2010/02/11/sql-server-alter-database-dbname-set-single_user-with-rollback-immediate/#comment-472099</link>
		<dc:creator><![CDATA[telluric]]></dc:creator>
		<pubDate>Thu, 09 May 2013 17:04:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7963#comment-472099</guid>
		<description><![CDATA[I beleive a have the solution. - thanks to Jonathan K. at SQLSkills. The ALTER DATABASE dbName command should be issued using a connection to the  dbName database, not master (or any other DB). This way your connection is picked up as the single_user connection. Otherwise, the next process that connects is picked up.]]></description>
		<content:encoded><![CDATA[<p>I beleive a have the solution. &#8211; thanks to Jonathan K. at SQLSkills. The ALTER DATABASE dbName command should be issued using a connection to the  dbName database, not master (or any other DB). This way your connection is picked up as the single_user connection. Otherwise, the next process that connects is picked up.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: telluric</title>
		<link>http://blog.sqlauthority.com/2010/02/11/sql-server-alter-database-dbname-set-single_user-with-rollback-immediate/#comment-471443</link>
		<dc:creator><![CDATA[telluric]]></dc:creator>
		<pubDate>Wed, 08 May 2013 15:19:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7963#comment-471443</guid>
		<description><![CDATA[I am having the same issue as Parimal. During an SSIS copy database we run the same statement (#2). Recently we have started to recieve the same lock error. 
Is there a method to guarentee a kill of all connections priro to the detach poriton of the copy process?]]></description>
		<content:encoded><![CDATA[<p>I am having the same issue as Parimal. During an SSIS copy database we run the same statement (#2). Recently we have started to recieve the same lock error.<br />
Is there a method to guarentee a kill of all connections priro to the detach poriton of the copy process?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: parimal</title>
		<link>http://blog.sqlauthority.com/2010/02/11/sql-server-alter-database-dbname-set-single_user-with-rollback-immediate/#comment-443313</link>
		<dc:creator><![CDATA[parimal]]></dc:creator>
		<pubDate>Sun, 24 Mar 2013 09:11:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7963#comment-443313</guid>
		<description><![CDATA[hello 
i performe this uery excute in sql2005:

1)  USE [master]
GO
ALTER DATABASE GuestAutomationSystemDB SET READ_WRITE WITH NO_WAIT
GO

2)ALTER DATABASE GuestAutomationSystemDB
SET SINGLE_USER WITH ROLLBACK IMMEDIATE;

This type of Error Occured:


Msg 5061, Level 16, State 1, Line 1
ALTER DATABASE failed because a lock could not be placed on database &#039;GuestAutomationSystemDB&#039;. Try again later.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.

please help me]]></description>
		<content:encoded><![CDATA[<p>hello<br />
i performe this uery excute in sql2005:</p>
<p>1)  USE [master]<br />
GO<br />
ALTER DATABASE GuestAutomationSystemDB SET READ_WRITE WITH NO_WAIT<br />
GO</p>
<p>2)ALTER DATABASE GuestAutomationSystemDB<br />
SET SINGLE_USER WITH ROLLBACK IMMEDIATE;</p>
<p>This type of Error Occured:</p>
<p>Msg 5061, Level 16, State 1, Line 1<br />
ALTER DATABASE failed because a lock could not be placed on database &#8216;GuestAutomationSystemDB&#8217;. Try again later.<br />
Msg 5069, Level 16, State 1, Line 1<br />
ALTER DATABASE statement failed.</p>
<p>please help me</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2010/02/11/sql-server-alter-database-dbname-set-single_user-with-rollback-immediate/#comment-421268</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 13 Feb 2013 07:58:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7963#comment-421268</guid>
		<description><![CDATA[It means that the database is used by some others. Close all connections and try]]></description>
		<content:encoded><![CDATA[<p>It means that the database is used by some others. Close all connections and try</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chintan</title>
		<link>http://blog.sqlauthority.com/2010/02/11/sql-server-alter-database-dbname-set-single_user-with-rollback-immediate/#comment-421112</link>
		<dc:creator><![CDATA[Chintan]]></dc:creator>
		<pubDate>Tue, 12 Feb 2013 22:06:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7963#comment-421112</guid>
		<description><![CDATA[I am getting above error while restoring Database from file]]></description>
		<content:encoded><![CDATA[<p>I am getting above error while restoring Database from file</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chintan</title>
		<link>http://blog.sqlauthority.com/2010/02/11/sql-server-alter-database-dbname-set-single_user-with-rollback-immediate/#comment-421111</link>
		<dc:creator><![CDATA[Chintan]]></dc:creator>
		<pubDate>Tue, 12 Feb 2013 22:06:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7963#comment-421111</guid>
		<description><![CDATA[Hi Pinal, I am getting &quot;Exclusive access could not be obtained because the database is in use.&quot; could you please help? I have tried all the solutions provided in your blogs, but it didn&#039;t help me this time.]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal, I am getting &#8220;Exclusive access could not be obtained because the database is in use.&#8221; could you please help? I have tried all the solutions provided in your blogs, but it didn&#8217;t help me this time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #006 &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2010/02/11/sql-server-alter-database-dbname-set-single_user-with-rollback-immediate/#comment-389236</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #006 &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 08 Dec 2012 01:30:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7963#comment-389236</guid>
		<description><![CDATA[[...] dropping it. Here is the quick tutorial regarding how to bring the database in single user mode: Using T-SQL &#124; Using [...]]]></description>
		<content:encoded><![CDATA[<p>[...] dropping it. Here is the quick tutorial regarding how to bring the database in single user mode: Using T-SQL | Using [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #005 &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2010/02/11/sql-server-alter-database-dbname-set-single_user-with-rollback-immediate/#comment-384375</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #005 &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 01 Dec 2012 01:30:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7963#comment-384375</guid>
		<description><![CDATA[[...] thing where we can use ALTER syntax to take database in single user mode. Read more about that over here and [...]]]></description>
		<content:encoded><![CDATA[<p>[...] thing where we can use ALTER syntax to take database in single user mode. Read more about that over here and [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: salmansohail@live.co.uk</title>
		<link>http://blog.sqlauthority.com/2010/02/11/sql-server-alter-database-dbname-set-single_user-with-rollback-immediate/#comment-338333</link>
		<dc:creator><![CDATA[salmansohail@live.co.uk]]></dc:creator>
		<pubDate>Tue, 28 Aug 2012 11:35:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7963#comment-338333</guid>
		<description><![CDATA[Use 

ALTER DATABASE [Demo]
 SET MULTI_USER

I am getting error msg 5064 level 16 sate 1, line 2
msg 5069 level 16, state 1, line 2
alter database statement failed.]]></description>
		<content:encoded><![CDATA[<p>Use </p>
<p>ALTER DATABASE [Demo]<br />
 SET MULTI_USER</p>
<p>I am getting error msg 5064 level 16 sate 1, line 2<br />
msg 5069 level 16, state 1, line 2<br />
alter database statement failed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zeeshan Khan</title>
		<link>http://blog.sqlauthority.com/2010/02/11/sql-server-alter-database-dbname-set-single_user-with-rollback-immediate/#comment-308429</link>
		<dc:creator><![CDATA[Zeeshan Khan]]></dc:creator>
		<pubDate>Mon, 02 Jul 2012 10:01:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7963#comment-308429</guid>
		<description><![CDATA[When i attach any database in SQL 2008 it display as Read Only, When i try to change Database--&gt; Properties --&gt;Options--&gt;Status to Read Only to False but it display error
&quot;Alter Failed for Database 

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

Unable to open the physical file &quot;&quot;. Operating system error 5: &quot;5(Access is denied.)&quot;.
Unable to open the physical file . Operating system error 5: &quot;5(Access is denied.)&quot;.
Database &#039;&#039; cannot be opened due to inaccessible files or insufficient memory or disk space.  
Please help me
Thanks]]></description>
		<content:encoded><![CDATA[<p>When i attach any database in SQL 2008 it display as Read Only, When i try to change Database&#8211;&gt; Properties &#8211;&gt;Options&#8211;&gt;Status to Read Only to False but it display error<br />
&#8220;Alter Failed for Database </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
ADDITIONAL INFORMATION:</p>
<p>An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Unable to open the physical file &#8220;&#8221;. Operating system error 5: &#8220;5(Access is denied.)&#8221;.<br />
Unable to open the physical file . Operating system error 5: &#8220;5(Access is denied.)&#8221;.<br />
Database &#8221; cannot be opened due to inaccessible files or insufficient memory or disk space.<br />
Please help me<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: karthik</title>
		<link>http://blog.sqlauthority.com/2010/02/11/sql-server-alter-database-dbname-set-single_user-with-rollback-immediate/#comment-196613</link>
		<dc:creator><![CDATA[karthik]]></dc:creator>
		<pubDate>Wed, 16 Nov 2011 06:01:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7963#comment-196613</guid>
		<description><![CDATA[Use 

ALTER DATABASE [Demo]
 SET MULTI_USER]]></description>
		<content:encoded><![CDATA[<p>Use </p>
<p>ALTER DATABASE [Demo]<br />
 SET MULTI_USER</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mangesh</title>
		<link>http://blog.sqlauthority.com/2010/02/11/sql-server-alter-database-dbname-set-single_user-with-rollback-immediate/#comment-179200</link>
		<dc:creator><![CDATA[Mangesh]]></dc:creator>
		<pubDate>Sat, 15 Oct 2011 11:14:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7963#comment-179200</guid>
		<description><![CDATA[ALTER DATABASE [Demo]
SET SINGLE_USER WITH ROLLBACK IMMEDIATE; 
after run above query my demo database work only single user,if i want to again same database as multiuser then with query apply

Regards
Mangesh]]></description>
		<content:encoded><![CDATA[<p>ALTER DATABASE [Demo]<br />
SET SINGLE_USER WITH ROLLBACK IMMEDIATE;<br />
after run above query my demo database work only single user,if i want to again same database as multiuser then with query apply</p>
<p>Regards<br />
Mangesh</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: visualtalks</title>
		<link>http://blog.sqlauthority.com/2010/02/11/sql-server-alter-database-dbname-set-single_user-with-rollback-immediate/#comment-153053</link>
		<dc:creator><![CDATA[visualtalks]]></dc:creator>
		<pubDate>Wed, 03 Aug 2011 07:39:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7963#comment-153053</guid>
		<description><![CDATA[Hello there.
Jasen, there are applications that will reconnect automatically if the connection is dropped (killing the SPIDs), so your solution is good for certain scenarios.
Best regards,
Calin]]></description>
		<content:encoded><![CDATA[<p>Hello there.<br />
Jasen, there are applications that will reconnect automatically if the connection is dropped (killing the SPIDs), so your solution is good for certain scenarios.<br />
Best regards,<br />
Calin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jasen</title>
		<link>http://blog.sqlauthority.com/2010/02/11/sql-server-alter-database-dbname-set-single_user-with-rollback-immediate/#comment-136668</link>
		<dc:creator><![CDATA[Jasen]]></dc:creator>
		<pubDate>Wed, 25 May 2011 21:56:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7963#comment-136668</guid>
		<description><![CDATA[Other helpful thing that helped was to do a sp_who2 and kill the spids of the users that are connected. Once I did that then I was able to Alter Database]]></description>
		<content:encoded><![CDATA[<p>Other helpful thing that helped was to do a sp_who2 and kill the spids of the users that are connected. Once I did that then I was able to Alter Database</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER – Making Database to Read Only – Changing Database to Read/Write Journey to SQLAuthority</title>
		<link>http://blog.sqlauthority.com/2010/02/11/sql-server-alter-database-dbname-set-single_user-with-rollback-immediate/#comment-129128</link>
		<dc:creator><![CDATA[SQL SERVER – Making Database to Read Only – Changing Database to Read/Write Journey to SQLAuthority]]></dc:creator>
		<pubDate>Sat, 16 Apr 2011 01:31:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7963#comment-129128</guid>
		<description><![CDATA[[...] If you face error that if database is already in use, you can resolve the same by making database in single user mode &#8211; here is the guideline SQL SERVER – ALTER DATABASE dbname SET SINGLE_USER WITH ROLLBACK IMMEDIATE. [...]]]></description>
		<content:encoded><![CDATA[<p>[...] If you face error that if database is already in use, you can resolve the same by making database in single user mode &#8211; here is the guideline SQL SERVER – ALTER DATABASE dbname SET SINGLE_USER WITH ROLLBACK IMMEDIATE. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Peter</title>
		<link>http://blog.sqlauthority.com/2010/02/11/sql-server-alter-database-dbname-set-single_user-with-rollback-immediate/#comment-61798</link>
		<dc:creator><![CDATA[Dave Peter]]></dc:creator>
		<pubDate>Thu, 25 Feb 2010 21:59:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7963#comment-61798</guid>
		<description><![CDATA[What do I need to do if I want to attach the database again?
It is because I need to detach the database and remove the log files and then attach again.

Thank you.

Dave]]></description>
		<content:encoded><![CDATA[<p>What do I need to do if I want to attach the database again?<br />
It is because I need to detach the database and remove the log files and then attach again.</p>
<p>Thank you.</p>
<p>Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mihir</title>
		<link>http://blog.sqlauthority.com/2010/02/11/sql-server-alter-database-dbname-set-single_user-with-rollback-immediate/#comment-61025</link>
		<dc:creator><![CDATA[Mihir]]></dc:creator>
		<pubDate>Thu, 11 Feb 2010 16:38:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7963#comment-61025</guid>
		<description><![CDATA[Nitin,

You will not receive the error that Pinal described unless there are open connections to the database in question.  Try creating the database, opening a connection, and then attempting a DROP from a different session.

Mihir]]></description>
		<content:encoded><![CDATA[<p>Nitin,</p>
<p>You will not receive the error that Pinal described unless there are open connections to the database in question.  Try creating the database, opening a connection, and then attempting a DROP from a different session.</p>
<p>Mihir</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jinesh</title>
		<link>http://blog.sqlauthority.com/2010/02/11/sql-server-alter-database-dbname-set-single_user-with-rollback-immediate/#comment-60986</link>
		<dc:creator><![CDATA[Jinesh]]></dc:creator>
		<pubDate>Thu, 11 Feb 2010 06:33:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7963#comment-60986</guid>
		<description><![CDATA[Great post, 
Thanks,
Jinesh.]]></description>
		<content:encoded><![CDATA[<p>Great post,<br />
Thanks,<br />
Jinesh.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nitin Sharma</title>
		<link>http://blog.sqlauthority.com/2010/02/11/sql-server-alter-database-dbname-set-single_user-with-rollback-immediate/#comment-60981</link>
		<dc:creator><![CDATA[Nitin Sharma]]></dc:creator>
		<pubDate>Thu, 11 Feb 2010 05:06:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7963#comment-60981</guid>
		<description><![CDATA[Hi Pinal,
  I cant get this POST.
I created the database and then dropped the DB..it didnt throw any error...
What is this script doing???

please share once again...]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,<br />
  I cant get this POST.<br />
I created the database and then dropped the DB..it didnt throw any error&#8230;<br />
What is this script doing???</p>
<p>please share once again&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
