In SQL Server 2005/2008, how can I tell if Snapshot Isolation is turned on? I know how to turn it on, but I can't find the incantation to get google to tell me how to query the state of the Snapshot Isolation option.
Powershell, really? what's wrong with good ol' fashioned T-SQL?
sys.databases is what you want. It has human readable description columns like snapshot_isolation_state_desc
SELECT snapshot_isolation_state_desc from sys.databases where name='adventureworks'
How to test whether the snapshot transaction isolation level is enabled
To test whether the snapshot transaction isolation level is enabled, follow these steps:
- Start SQL Server Profiler.
- Create a new trace to connect to the data source that you specified in the Analysis Services project.
- In the Trace Properties dialog box, click the Events Selection tab.
- In the TransactionID column, click to select the check boxes in the row for the SQL:BatchCompleted event and in the row for the SQL:BatchStarting event.
Note To display the TransactionID column, click to select the Show all columns check box.
- Click Run to start the trace.
In Business Intelligence Development Studio, process the Analysis Services project.
In SQL Server Profiler, look for the SQL:BatchCompleted events and for the SQL:BatchStarting events that have the same value in the TransactionID column. Typically, these events contain the SELECT statement in the TextData column. For these events, obtain the session ID in the SPID column.
To connect to the data source,start SQL Server Management Studio.
Create a new query, and then run the following Transact-SQL statement.
select session_id,Transaction_Isolation_Level from sys.dm_exec_sessions where session_id=
Note In this statement, is a placeholder for the session ID that you obtained in step 7.
- On the Results tab, note the value in the Transaction_Isolation_Level column. This value indicates the transaction isolation level that you are using in the Analysis Services project. When the snapshot transaction isolation level is enabled, the value in the Transaction_Isolation_Level column is 5.
The following table shows the values in the Transaction_Isolation_Level column and the corresponding transaction isolation levels.