Created
March 22, 2019 21:02
-
-
Save LitKnd/ae231bcd669a9a6c2cc23aacc0429974 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Note: technically snapshot isolation can be in a 'pending' state | |
# In this state it is waiting for open transactions to complete before the setting turns on | |
# This script does not check for that state, it simply looks to see if it's off and enables it in that case | |
IF | |
( | |
SELECT snapshot_isolation_state_desc | |
FROM sys.databases | |
WHERE database_id = DB_ID() | |
) = 'OFF' | |
BEGIN | |
PRINT 'Enabling snapshot isolation...'; | |
ALTER DATABASE CURRENT SET ALLOW_SNAPSHOT_ISOLATION ON; | |
END; | |
ELSE | |
PRINT 'Snapshot isolation not set to off, moving on...'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment