From: Roy Goldhammer on
Hello there

On sql server 2005 there are system tables which gives me exact data about
table activities: select, update, delete, insert...

it gives me good idea about activity of server.

Is there also activities table about store procedures as well? on 2005 or
2008


From: Erland Sommarskog on
Roy Goldhammer (roy(a)top.com) writes:
> On sql server 2005 there are system tables which gives me exact data about
> table activities: select, update, delete, insert...
>
> it gives me good idea about activity of server.
>
> Is there also activities table about store procedures as well? on 2005 or
> 2008

In SQL 2008 there is a DMV sys.dm_exec_procedure_stats.


--
Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
From: Uri Dimant on
In SQL Server 2005 you can try the sys.dm_db_index_usage_stats data
management view, look at the column last_user_update, you can also see when
the table was last accessed ......


SELECT
last_user_seek = MAX(last_user_seek),
last_user_scan = MAX(last_user_scan),
last_user_lookup = MAX(last_user_lookup),
last_user_update = MAX(last_user_update)
FROM
sys.dm_db_index_usage_stats
WHERE
[database_id] = DB_ID()

-- AND OBJECTPROPERTY(object_id, 'IsMsShipped') = 0



"Roy Goldhammer" <roy(a)top.com> wrote in message
news:uGA8jTKeKHA.2596(a)TK2MSFTNGP04.phx.gbl...
> Hello there
>
> On sql server 2005 there are system tables which gives me exact data about
> table activities: select, update, delete, insert...
>
> it gives me good idea about activity of server.
>
> Is there also activities table about store procedures as well? on 2005 or
> 2008
>