﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Administering / SQL Server 2005  / Isolation levels / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 22 May 2013 09:50:44 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Isolation levels</title><link>http://www.sqlservercentral.com/Forums/Topic835691-146-1.aspx</link><description>Here is some more info of your interest.Query with TEXT and average CPU time for the top five queries.SELECT TOP 5 total_worker_time/execution_count AS [Avg CPU Time],    SUBSTRING(st.text, (qs.statement_start_offset/2)+1,         ((CASE qs.statement_end_offset          WHEN -1 THEN DATALENGTH(st.text)         ELSE qs.statement_end_offset         END - qs.statement_start_offset)/2) + 1) AS statement_textFROM sys.dm_exec_query_stats AS qsCROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS stORDER BY total_worker_time/execution_count DESC;This was taken from  http://msdn.microsoft.com/en-us/library/ms181929.aspxor a simple version such as this one to find the text of all queries with latest Query on top.Select s.text,* from sys.sysprocesses pCross apply sys.dm_exec_sql_text (p.sql_handle) swhere p.spid &amp;gt;50and p.spid not in (select @@spid)Order by p.last_batch descOr DECLARE @spid intSET @spid = (SELECT top 1 SPID from master..sysprocesses order by last_batch desc)DBCC INPUTBUFFER (@spid)ORDECLARE @spid intDECLARE @handle binary(20)SET @spid = (SELECT top 1 SPID from master..sysprocesses order by last_batch desc)SET @handle = (SELECT sql_handle from master..sysprocesses where spid = @spid)SELECT * FROM ::fn_get_sql(@Handle)for more infor about the ISOLATION and Lock HINTS http://dbanation.com/?p=114</description><pubDate>Thu, 17 Dec 2009 09:07:54 GMT</pubDate><dc:creator>MannySingh</dc:creator></item><item><title>RE: Isolation levels</title><link>http://www.sqlservercentral.com/Forums/Topic835691-146-1.aspx</link><description>Depends on what you're doing. Yes, the isolation level set is just for that session / connection until you specify otherwise, it does not have an affect on other queries running in other sessions etc. The question is, are you doing anything else in that session after you run this query that needs to change the isolation level? If so, then do another SET ISOLATION LEVEL...to a level that fulfills the requirement.</description><pubDate>Thu, 17 Dec 2009 08:13:58 GMT</pubDate><dc:creator>NickBalaam</dc:creator></item><item><title>RE: Isolation levels</title><link>http://www.sqlservercentral.com/Forums/Topic835691-146-1.aspx</link><description>[quote][b]BaddaBing (12/17/2009)[/b][hr]No, the READ UNCOMMITTED is used so the query doesn't have an impact. It doesn't care about locks and places none of its own[/quote]Thanks for your reply. So setting isolation level to read uncommited is for only this query?or do we need to change Isolation level to read commited again after executing this query</description><pubDate>Thu, 17 Dec 2009 08:08:46 GMT</pubDate><dc:creator>nihal9200_kwada</dc:creator></item><item><title>RE: Isolation levels</title><link>http://www.sqlservercentral.com/Forums/Topic835691-146-1.aspx</link><description>No, the READ UNCOMMITTED is used so the query doesn't have an impact. It doesn't care about locks and places none of its own</description><pubDate>Thu, 17 Dec 2009 07:56:35 GMT</pubDate><dc:creator>NickBalaam</dc:creator></item><item><title>Isolation levels</title><link>http://www.sqlservercentral.com/Forums/Topic835691-146-1.aspx</link><description>I am trying to understand the below script to find out the long/slow running sql statement.http://www.sqlservercentral.com/articles/DMV/64425/BEGIN    -- Do not lock anything, and do not get held up by any locks.    SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED    -- What SQL Statements Are Currently Running?    SELECT [Spid] = session_Id	, ecid	, [Database] = DB_NAME(sp.dbid)	, [User] = nt_username	, [Status] = er.status	, [Wait] = wait_type	, [Individual Query] = SUBSTRING (qt.text,              er.statement_start_offset/2,	(CASE WHEN er.statement_end_offset = -1	       THEN LEN(CONVERT(NVARCHAR(MAX), qt.text)) * 2		ELSE er.statement_end_offset END -                                 er.statement_start_offset)/2)	,[Parent Query] = qt.text	, Program = program_name	, Hostname	, nt_domain	, start_time    FROM sys.dm_exec_requests er    INNER JOIN sys.sysprocesses sp ON er.session_id = sp.spid    CROSS APPLY sys.dm_exec_sql_text(er.sql_handle)as qt    WHERE session_Id &amp;gt; 50              -- Ignore system spids.    AND session_Id NOT IN (@@SPID)     -- Ignore this current statement.    ORDER BY 1, 2ENDNow my question is:- is there any impact on production database, because we are using read uncommited isolation level. </description><pubDate>Thu, 17 Dec 2009 07:53:50 GMT</pubDate><dc:creator>nihal9200_kwada</dc:creator></item></channel></rss>