Bill's Crappy Tech Blog

Friday, August 6, 2010

Set a database into Single User Mode











ALTER DATABASE [URSTUPIDDATABASE] SET MULTI_USER WITH NO_WAIT


ALTER DATABASE [URSTUPIDDATABASE] SET SINGLE_USER WITH NO_WAIT







or





EXEC sp_dboption 'URSTUPIDDATABASE', 'single user', 'false'

EXEC sp_dboption 'URSTUPIDDATABASE', 'single user', 'true'


Posted by Bill Reed at 5:53 AM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: SQL, t-SQL

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2012 (2)
    • ►  July (1)
    • ►  April (1)
  • ►  2011 (2)
    • ►  August (1)
    • ►  April (1)
  • ▼  2010 (54)
    • ►  December (2)
    • ►  October (2)
    • ►  September (5)
    • ▼  August (11)
      • SQL Server 2008 R2 - 2 node cluster build
      • FreeNAS - This thing rocks.
      • Windows 2008 R2
      • Stop whining list
      • Users in SharePoint with email addresses not assoc...
      • To put the entire SQL server into single user mode
      • Set a database into Single User Mode
      • t-SQL to allow comments and ping backs on all your...
      • Virtual Domain Controllers
      • Moving the System databases for SQL 2005 on a cluster
      • Updating the TEMPDB
    • ►  May (6)
    • ►  April (5)
    • ►  March (6)
    • ►  February (9)
    • ►  January (8)
  • ►  2009 (4)
    • ►  December (4)

About Me

Bill Reed
View my complete profile
Awesome Inc. theme. Powered by Blogger.