I am a begginer to SQL. I am truly limited with SQL language.
Every month we have to do a month end closing for our company. In order for us to do this we need to get everyone off the database to proceed. This process is horrible and generally takes at least 1/2hr to 45 min. to do so. i am looking for a command that i can use in query analyzer if possible to force the users out of the database. if that isnt an option can you recommend another program in which i can do this. i am at a loss and need some help..... thanks

Forcing Users to log out of SQL 2000
Serg256
Did you have a look in the BOL for ALTER DATABASE
ALTER DATABASE SomeDatabase
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE
or from the syntax with a delay of x seconds:
<termination> ::=
{
ROLLBACK AFTER integer [ SECONDS ]
| ROLLBACK IMMEDIATE
| NO_WAIT
}
HTH, Jens Suessmeyer.
---
http://www.sqlserver2005.de
---
rgreiser
ok thank you i will try this at the end of the month
i do appriciate your time!!
thanks
Hasan9552
what is the command
can i use it in query analyze
thanks again
Matthew Kane
SUre thisis quite easy, the command kills all the user sessions immediately. If you want to wait a respective moment you can use the WAIT FOR keyword, but with the keyword IMMEDIATELY all User will be banned out of the database and their transactions will be roled back (if any transaction is open)
HTH, Jens Suessmeyer.
---
http://www.sqlserver2005.de
---
Anil Dhiman
i am unsure of what you mean. as i stated i am truly a beginner with SQL.
can you explain it to me like i am 4 lol
thanks
jvwardle
HTH, Jens Suessmeyer.
---
http://www.sqlserver2005.de
---