问题
I've successfully only been able to see transaction isolation level
events in the Audio Login
event. Are there any other ways to monitor the transaction isolation level
changes using SQL Profiler or using some other tool? The reason I ask is because SQL Profiler does not seem to be able to output the events in the right order or it skips events because when setting the IsolationLevel
to Serializable
in my app it still shows transaction isolation level read committed
.
Example Audit Login
in SQL Profiler:
-- network protocol: Named Pipes
set quoted_identifier on
set arithabort off
set numeric_roundabort off
set ansi_warnings on
set ansi_padding on
set ansi_nulls on
set concat_null_yields_null on
set cursor_close_on_commit off
set implicit_transactions off
set language us_english
set dateformat mdy
set datefirst 7
set transaction isolation level serializable
回答1:
I am afraid there isn't one.
Even if there was one, what would you want to see where multiple tables were queried in a join and one or more had NOLOCK which is read uncommitted?
The profiler reports queries at the statement level not the table level so you would have a mix of transaction isolation levels (this is true of the profiler and extended events)
The best you could do is to manually parse the statement start (batch and procedure) and look for the set transaction isolation level.
ed
来源:https://stackoverflow.com/questions/31539500/how-to-monitor-transaction-isolation-level-changes-in-sql-profiler-or-in-any-oth