﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / T-SQL (SS2K5)  / database stuck in single user and no spid / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sun, 19 May 2013 19:06:48 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: database stuck in single user and no spid</title><link>http://www.sqlservercentral.com/Forums/Topic1360080-338-1.aspx</link><description>You can also see who is holding a lock on the database by querying sys.dm_tran_locks.Kill the session_id and change to multi user by executing ALTER DATABASE db SET MULTI_USER.</description><pubDate>Fri, 21 Sep 2012 11:07:21 GMT</pubDate><dc:creator>Nils Gustav Stråbø</dc:creator></item><item><title>RE: database stuck in single user and no spid</title><link>http://www.sqlservercentral.com/Forums/Topic1360080-338-1.aspx</link><description>in the end had to get someone to log into server with sys admin user and detach and then re-attach database.Thanks for the tip about the management studio. Next time i will try sqlcmd</description><pubDate>Wed, 19 Sep 2012 01:12:45 GMT</pubDate><dc:creator>icampbell</dc:creator></item><item><title>RE: database stuck in single user and no spid</title><link>http://www.sqlservercentral.com/Forums/Topic1360080-338-1.aspx</link><description>i hope you can also use "sp_dboptions '&amp;lt;DBName&amp;gt;' 'multiuser' 'true'"</description><pubDate>Tue, 18 Sep 2012 10:16:53 GMT</pubDate><dc:creator>prasanna.vinay</dc:creator></item><item><title>RE: database stuck in single user and no spid</title><link>http://www.sqlservercentral.com/Forums/Topic1360080-338-1.aspx</link><description>Are you using SQL Management Studio to issue these commands? It has an annoying tendency of opening multiple connections to the database, so you'd be better off using SQLCMD to test this out.</description><pubDate>Tue, 18 Sep 2012 03:42:47 GMT</pubDate><dc:creator>paul.knibbs</dc:creator></item><item><title>RE: database stuck in single user and no spid</title><link>http://www.sqlservercentral.com/Forums/Topic1360080-338-1.aspx</link><description>[quote][b]Sudhakar Vallamsetty (9/17/2012)[/b][hr]Try this and see if it fixes ur problem.use MasterGoselect * from master.sys.sysprocesseswhere spid&amp;gt;50 -- don't want system sessions  and dbid = DB_ID(name of database in question)--Find the SPID which is making connection to your single_user mode DB and KIll itKill 100 -- replace 100 with the SPID which you get from the above queryALTER database 'your DB name' set MULTI_USER with ROLLBACK IMMEDIATEHi Sudhakar,I already tried this and there are no open connections listed against the database[/quote]</description><pubDate>Mon, 17 Sep 2012 05:06:36 GMT</pubDate><dc:creator>icampbell</dc:creator></item><item><title>RE: database stuck in single user and no spid</title><link>http://www.sqlservercentral.com/Forums/Topic1360080-338-1.aspx</link><description>Try this and see if it fixes ur problem.use MasterGoselect * from master.sys.sysprocesseswhere spid&amp;gt;50 -- don't want system sessions  and dbid = DB_ID(name of database in question)--Find the SPID which is making connection to your single_user mode DB and KIll itKill 100 -- replace 100 with the SPID which you get from the above queryALTER database 'your DB name' set MULTI_USER with ROLLBACK IMMEDIATE</description><pubDate>Mon, 17 Sep 2012 05:01:17 GMT</pubDate><dc:creator>Sudhakar Vallamsetty</dc:creator></item><item><title>database stuck in single user and no spid</title><link>http://www.sqlservercentral.com/Forums/Topic1360080-338-1.aspx</link><description>Hi i have a dev database that is stuck in single user modewhen i try and access the database i can't a connection already in use.However when i use exec sp_who - no connections are displayed against the database.How can i get out of this please?:w00t: As i would like to overwrite this database with the live database.</description><pubDate>Mon, 17 Sep 2012 04:29:22 GMT</pubDate><dc:creator>icampbell</dc:creator></item></channel></rss>