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
Author
Message
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: Thursday, June 6, 2013 10:53 AM
Points: 36, Visits: 76
hello,
how i can verify the last date modify of a table or a stored procedure.

thank you for your help

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


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 2:37 PM
Points: 20,734, Visits: 32,511
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


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 11:55 AM
Points: 12,905, Visits: 32,165
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

--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
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 5:28 AM
Points: 2,114, Visits: 5,502
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/
Post #1430490
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse