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.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Finding Column Usage?

Author  Topic 

Bill_C
Constraint Violating Yak Guru

299 Posts

Posted - 2013-06-06 : 02:53:13

Is there a way to identify which column in a table is the most searched on?
I would like to identify the columns in each table that has the highest number of searches on it, e.g.
Select * from table1 where column1 = 'blahblah'

or

Select @ from table1 order by column1

Is there a dmv(s) or whatever i can use to glean this information from?

Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-06-06 : 03:13:28
if it has an index then use this

http://sqlserverpedia.com/wiki/DM_Objects_-_Sys.dm_db_index_usage_stats

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

Bill_C
Constraint Violating Yak Guru

299 Posts

Posted - 2013-06-06 : 04:39:02
Some have no index, but thanks for the pointer.

B
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-06-06 : 04:42:48
No prbs...you're welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2013-06-06 : 10:46:46
if you have knowledge of the queries - such as , they are all stored procedures , you could do a serach on the column reference , and then monitor how often the stored procedure is executed

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
   

- Advertisement -