January 23, 2012 at 11:08 am
unable to bring database in single user mode .its keeps on running
ultimately I have to cancel the command. any advice
thanks is advance
January 23, 2012 at 11:10 am
There's another existing connection and you didn't specify a ROLLBACK option on the Alter Database?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 23, 2012 at 11:11 am
any transaction might be using the database. that's why your transaction got blocked.
You can try with killing that transaction or use this query to rollback that particular transaction.
Alter database dbname set single_user with rollback immediate
January 23, 2012 at 11:11 am
if you use the optional WITH ROLLBACK IMMEDIATE, it will disconnect everyone from the database.
ALTER DATABASE Logging_demoSP2 SET SINGLE_USER WITH ROLLBACK IMMEDIATE
--do some exclusive stuff, like RESTORE
--if the database as in Multi_user mode at the time of the backup,
--that will be the mode after the restore, but just in case, put it back.
ALTER DATABASE Logging_demoSP2 SET MULTI_USER
Lowell
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply