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.
Author |
Topic |
jagpalsingh4
Starting Member
7 Posts |
Posted - 2008-06-09 : 07:04:41
|
Hi,Can anybody tell how can we see long running queries with tsql i have query for sql 2005 but it doesnt work with 2000.so plz help me Regards Jagpal Singhjagpalsingh |
|
mcrowley
Aged Yak Warrior
771 Posts |
Posted - 2008-06-09 : 15:22:32
|
You can detect them with sp_who2, just like SQL 2005. You can see the command itself (or part of it) by eitherDBCC INPUTBUFFER(spid)or::fn_get_sql() |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-06-09 : 15:24:34
|
You should view this information in SQL Profiler. After you have gathered the data and saved it into a table, run this to see your long-running queries:SELECT TOP 1000 Duration, TextDataFROM YourTraceTableWHERE TextData IS NOT NULLORDER BY Duration DESCTara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
 |
|
|
|
|