If you need to access a Database in Single_user mode, to either take it offline or change to MULTI_USER, change the DEADLOCK_PRIORITY so your process does not get picked as deadlock victirm.
SET DEADLOCK_PRIORITY HIGH--KILL 58 -- kill the session using the databaseALTER DATABASE [DB_NAME] SET OFFLINE WITH ROLLBACK IMMEDIATE--ALTER DATABASE [DB_NAME] SET MULTI_USER WITH ROLLBACK IMMEDIATESET DEADLOCK_PRIORITY NORMAL
No comments:
Post a Comment