March 13, 2013 at 9:26 am
hello,
how i can verify the last date modify of a table or a stored procedure.
thank you for your help
Boucicaut
March 13, 2013 at 9:35 am
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.
March 13, 2013 at 9:37 am
sys.objects has the last time the DDL of an object was modified.
here's a simple example
SELECT
objz.create_date,
objz.modify_date,
SCHEMA_NAME(objz.schema_id) AS SchemaName,
objz.name
FROM sys.objects objz
--WHERE objz.name = 'YourTableOrProcedure'
ORDER BY objz.modify_date DESC
Lowell
March 13, 2013 at 9:45 am
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).
Adi
--------------------------------------------------------------
To know how to ask questions and increase the chances of getting asnwers:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy