| Login

Search this Blog


Links I like to keep around


Here are the most recent postings to this blog. Use the archive calendar or search to find other entries.
Jun27

Written by:R Teachout
6/27/2008 9:59 PM 

Ever need to immediately disconnect users on a database, such as when running a Database Restore? Here's a quick trick.

 

ALTER DATABASE [Misc_Stuff] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO


No go do your Restore.

When you are done, you can run the following.
(Generally you only do this to restore a database, which automatically gets reset back to multi-user after the restore..)

ALTER
DATABASE [Misc_Stuff] SET MULTI_USER WITH ROLLBACK IMMEDIATE
GO

Tags:

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment  Cancel 

To succeed in the world it is not enough to be stupid, you must also be well-mannered.
-Voltaire

Inspired by Nina