TOP 10 sql statements

  • Can any one tell me how we can get top 10 statements using SQL Profiler and what are the counters we need to setup.

    LEt me know is there any book or site where i can refer to SQL Profiler.

    venkatesh


    venkatesh

  • Profiler has some options for grouping, but the best/easiest way is to just capture all the sql statements, then throw into a table where you can analyze any way you want. Profiling is moderately expensive, so only capture the columns you need. Brian Kelley has some stuff posted on Profiler you may find helpful.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • Thanks Andy, I was doing same thing but is there are any specifiec counters where group to get the apporiate results.

    Let me know if you any samples.

    venkatesh


    venkatesh

  • I'd use the TSQL:SQL:StmtCompletedEvent, for columns you want textdata, duration, reads, writes. Probably apply a filter to limit it to the database you're checking. How you get the Top 10 depends on what you really want, the ones most often executed, the ones take the longest in duration, or reads, or writes.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • Doesn't the index tuning tool give you a top 10?

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply