Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
catparks
Starting Member
18 Posts |
Posted - 2005-07-13 : 11:25:54
|
I have a DTS job that drops a database and restores it as read-only everyday. The job fails when a user is using the database at the time the job attempts to drop the database. Does anyone know how I can terminate all users before the job begins?Thanks! |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2005-07-13 : 12:50:10
|
| ALTER DATABASE DBNameGoesHere SET SINGLE_USER WITH ROLLBACK IMMEDIATEGOTara |
 |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2005-07-13 : 12:51:42
|
| I think this will work:alter database <Database_name> set single_user with rollback immediateBe One with the OptimizerTG |
 |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2005-07-13 : 12:52:59
|
ah, some things never change... by TaraBe One with the OptimizerTG |
 |
|
|
|
|
|