Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

sql2005 Expand / Collapse
Posted Wednesday, March 13, 2013 9:26 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, July 17, 2015 9:12 AM
Points: 38, Visits: 80
how i can verify the last date modify of a table or a stored procedure.

thank you for your help

Post #1430474
Posted Wednesday, March 13, 2013 9:35 AM



Group: General Forum Members
Last Login: Today @ 12:33 PM
Points: 22,269, Visits: 35,233
Look at the table sys.objects, it has the columns create_date and modify_date. This won't tell you the last table data in a table was updated or when a stored proc was run.

Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1430482
Posted Wednesday, March 13, 2013 9:37 AM



Group: General Forum Members
Last Login: Today @ 12:21 PM
Points: 13,783, Visits: 35,414
sys.objects has the last time the DDL of an object was modified.

here's a simple example
SCHEMA_NAME(objz.schema_id) AS SchemaName,
FROM sys.objects objz
--WHERE = 'YourTableOrProcedure'
ORDER BY objz.modify_date DESC


--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1430484
Posted Wednesday, March 13, 2013 9:45 AM


Group: General Forum Members
Last Login: Wednesday, September 9, 2015 1:35 AM
Points: 2,153, Visits: 5,745
For stored procedure you can check the column modify_date in sys.objects. Unfortunately with table it can be harder. If I remember correctly rebuild for the clustered index or the table modifies the value of column modify_date, so I'm not sure that you can see that without preparing something that logs all tables' modifications (for example DDL trigger).


To know how to ask questions and increase the chances of getting asnwers:

For better answers on performance questions, click on the following...
Post #1430490
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse