Comments
3 comments
-
Yes, e.g.
USE master ALTER DATABASE pubs SET OFFLINE WITH ROLLBACK IMMEDIATE ALTER DATABASE pubs SET ONLINE
-
Glad to hear that Petey. In the off chance that a long running transaction needs to be rolled back that will take a long time will V 6 wait or will it give up after a set period of time?
Thanks
Chris
Note. Our approach when we need to take an SQL Backup backup file and restore it to another database is to set the database to single user and rollback immed similar to you. On occasion we had problems with orphan DTC spids that stopped the alter database from finishing. In fact just last Friday I waited over 40 minutes before the alter database took effect because someting was holding it and got 952 messages showing the database in transition. -
The ALTER DATABASE command is ran in the same batch as the RESTORE command, so it'll wait. We'll need to see how that goes.
Add comment
Please sign in to leave a comment.
Thanks
Chris