Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

modification date

Status
Not open for further replies.

michelleqw

Programmer
Jan 4, 2004
120
0
0
DE
Dear sqlserver users,

In the enterprise manager we are looking to the stored procedures / tables etc, we always see a column with the creating date. This date can be very interesting but more important is the modify date.

Is there any possibility to get this date and if yes how do we do that.

Nice regards,

Michelle.
 
As Far as my knowledge there is no such modify date upto SQL 2000.
 
ther is a column somewhere in one of the system tables which has a column called something like last modified date - cant remember where it is though or whether its what you are looking for.

[bandito] [blue]DBomrrsm[/blue] [bandito]
 
Run this in QA in the DB you are interested in:
Code:
select * from INFORMATION_SCHEMA.routines

Then look to the far right - last column of the results which is a column called LAST_ALTERED - but again not sure if its what you want.


[bandito] [blue]DBomrrsm[/blue] [bandito]
 
If you want the date the data was last modified, you need to program the functionality in. I suggest an update trigger which puts the current date into a ModifiedDate field every time the record is updated. It probably is also a good idea if you are going to do this to add a ModifiedBy field and put the SYSTEM_USER value into that field inthe same trigger.

Or you could consider if you need audit tables to track the actual changes and the former values.

Questions about posting. See faq183-874
 
dbomrrsm said:
Then look to the far right - last column of the results which is a column called LAST_ALTERED - but again not sure if its what you want.

Unfortunately this column is mapped to sysobjects.crdate. If you ALTER PROCEDURE/FUNCTION, it's value won't be changed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top