Highest number of SELECT statements on a table

  • I was wondering if there exists a way to find out which records of a particular table have been accessed most i.e. the list of record-ids accessed due to SELECT statements on a particular table.

    As an example, let's say there is a table "MyTable" containing 3 records and if I want to know which record out of these 3 was accessed most using SELECT statement, how do I know?

    Is there any stored procedure/script/logging/tracing option available to get the information?

    I am sure SQL Server being so rich there must be a way!

    Could anybody help me please?

  • You can use SQL profiler to capture all the commands that are run against a server. That won't tell you what rows were affected, it will just give you the commands run.

    If you want to see what rows are affected by selects, you'd have to do some extra work. It's fairly easy for updates (triggers) but selects don't fire triggers.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • hi pankaj ,

    i dont think we have any option by which we can calculate SELECT coomand but this can be done in front end by putting counter on select sqlcmd (if you have front end )

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

Viewing 3 posts - 1 through 2 (of 2 total)

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