September 21, 2008 at 1:36 pm
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?
September 21, 2008 at 1:47 pm
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
September 22, 2008 at 1:13 am
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