tags:

views:

650

answers:

2

How can we get information regarding poorly performing sqls(taking too much time for execution)

Does MS SQL server maintains tables/views (Similar to v$sql in Oracle) for storing sql queries.

+5  A: 

I Use the SQL Profiler to collect statistic data wich I then can use to nail down where there are need to do some work, tweak indexes and so on.

Here are some tips about monitoring with Profiler: http://www.developer.com/db/article.php/3490086 http://vyaskn.tripod.com/analyzing_profiler_output.htm

Stefan
Do we have any SQL query to achieve the same?Thanks in advance
Kamal Joshi
You can have profiler dump the information into a table that you can then use SQL to search.
wcm
+1  A: 

take a look at sys.dm_exec_query_stats and this page. SQL Server 2005+ only.

Mladen Prajdic