Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 isolation levels

Author  Topic 

laddu
Constraint Violating Yak Guru

332 Posts

Posted - 2009-12-16 : 18:04:01
How to know the default isolation level of sql server thru MANAGEMENT STUDIO

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-12-16 : 18:19:06
Well the default is READ_COMMITTED. Are you instead asking what isolation level a particular database is using?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2009-12-17 : 07:27:50
dbcc useroptions
Go to Top of Page

laddu
Constraint Violating Yak Guru

332 Posts

Posted - 2009-12-17 : 08:49:42
quote:
Originally posted by lionofdezert

dbcc useroptions



@tkizer
@lionofdezert
Thanks for your reply.

DBCC useroptions is know for each database isolevel level or server level.

I am trying to understand the below script

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 > 50 -- Ignore system spids.
AND session_Id NOT IN (@@SPID) -- Ignore this current statement.
ORDER BY 1, 2
END


What happens if we use read uncommited, any impact on production database? or above script is for only query?

Is there any other ways to find out the slow running queries, If you would help me, really I really it.


Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-12-17 : 10:25:58
That script is just for that session.

Use SQL Profiler to determine what's slow.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

laddu
Constraint Violating Yak Guru

332 Posts

Posted - 2009-12-17 : 10:40:59
When you say SQL Profiler what counters we need to add to find out, sorry kind of new to this
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-12-17 : 10:50:55
It depends on how data access is done by the application. Just start with the default template making sure to save it to a file rather than to a table for performance reasons.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -