Click here to monitor SSC
SQLServerCentral is supported by Redgate
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 @ 8:52 AM
Points: 23,522, Visits: 37,746
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 @ 7:57 AM
Points: 14,549, Visits: 38,417
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


help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
Post #1430484
Posted Wednesday, March 13, 2013 9:45 AM


Group: General Forum Members
Last Login: Today @ 7:13 AM
Points: 2,199, Visits: 6,042
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