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 2005 Forums
 Transact-SQL (2005)
 Query when tables were queried

Author  Topic 

lappy
Starting Member

6 Posts

Posted - 2009-03-02 : 12:25:46
Hi, I hope I've got this in the wrong forum. Sorry if I haven't. I've been looking into this for an hour or so now but I haven't managed to find anything and am worried that I won't be able to do this.

I want to query to find out how often a table is queried on a weekly basis from a given date. I've done similar things and used DATEPART() so that bit (hopefully) is OK. I guess what I'm looking for is a way to query some kind of metadata of a table to get some raw data to do things with. The rows do have created and modified dates, but I need to include retrieval of data without manipulation too. Its this part that I need some help with.

Are there any stored procedures, tables, functions, etc. that could me help me do this please?

Thanks

Skorch
Constraint Violating Yak Guru

300 Posts

Posted - 2009-03-02 : 12:34:55
Sounds like what you need to do is run a trace in SQL Profiler and save it to a log file. I'm not aware of any other method of accomplishing what you're trying to do as SQL server doesn't save metadata about all the queries ever run on the server.

Some days you're the dog, and some days you're the fire hydrant.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-02 : 12:39:25
what all information do you need regarding table? the column info which changed?
Go to Top of Page

lappy
Starting Member

6 Posts

Posted - 2009-03-03 : 11:37:44
The information I'm mainly after is the frequency of queries. Basically I'm trying to report on how often a table is queried, updated, added to, etc. As this doesn't seem to be available (and hardly surprisingly so) I'll do the next best thing and use the created and modified dates, and not worry about the general queries. Thanks anyway. :)
Go to Top of Page
   

- Advertisement -