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 |
ankarao11
Starting Member
2 Posts |
Posted - 2009-04-21 : 09:40:59
|
Dear All,how do i get 5 or 10 slowest sql statements in MS Sql server 2005Txs |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-04-21 : 09:47:23
|
You can either use some of the built-in new DM views, or you can profile the server with SQL profiler. E 12°55'05.63"N 56°04'39.26" |
 |
|
ankarao11
Starting Member
2 Posts |
Posted - 2009-04-21 : 11:07:33
|
Dear Peso,i am new to sql server. and txs for ur response. could you please tell me in more detail. |
 |
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2009-04-21 : 12:37:51
|
select top 5 p.textfrom sys.dm_exec_query_stats sCROSS APPLY sys.dm_exec_sql_text(s.plan_handle) porder bys.max_elapsed_time Desc==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|