![]() ![]() If other users are connected to the database, an Open Connections message will appear. In the Database Properties dialog box, click the Options page.įrom the Restrict Access option, select Single. Right-click the database to change, and then click Properties. In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance. Here is a sample set of code that puts the database in single user mode Once the database is in single user mode it is now easy to perform the restore Alter Database to Single User Mode and Restore Long running transactions may take some time to rollback. So rolling things back should not be an issue, but you still need to be aware that Systems since you are doing a restore you don't care about the transactions anyway, Long time, so be aware of what is running on your systems. The rollback process should work without issue,īut if you have very long running transactions the rollback process could take a Note: when using the ROLLBACK option you are rolling back any open transactions To the database and can then do the restore without a problem. Once the database has been put in single user mode, you have exclusive access ![]() Will not always work if there are open transactions. The cleanest approach, because it doesn't rollback any transactions, but it Time and if the transactions are not complete the process will fail. WITH NO_WAIT - this option will only set the database to single user mode.We are specifying that the process should wait 30 seconds before rolling back WITH ROLLBACK AFTER nnn - this option will rollback all open transactionsĪfter waiting nnn seconds for the open transactions to complete. ![]() It just begins rolling back all open transactions
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |