Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Old Forums
 CLOSED - General SQL Server
 How can i lock database in SQL Server 2000
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

AskSQLTeam
Ask SQLTeam Question

USA
0 Posts

Posted - 09/19/2006 :  07:41:57  Show Profile  Visit AskSQLTeam's Homepage
Md. Shafiuzzaman writes "How can I lock a database in SQL Server 2000?"

Kristen
Test

United Kingdom
22858 Posts

Posted - 09/19/2006 :  08:13:11  Show Profile
What do you want to lock it for? If you want to prevent users accessing it whilst you perform a new version roll-out then:

ALTER DATABASE MyDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE

or possibly

ALTER DATABASE MyDatabaseName SET RESTRICTED_USER WITH ROLLBACK IMMEDIATE

if the application is not logging on as SA - which is a VERY bad idea anyway!

If you just want to lock the database whilst you update a few records then there are better ways of solving that particular problem

Kristen
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000