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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determining last Table Modification Date

Status
Not open for further replies.

WZUP

Programmer
Apr 21, 2003
178
US
Sorry, I sure this is a very dumb question. I'm coming from a RMS File structure.

One of the file properties was the date stamped of the last modification per file.

Is there such a feature on SQL 2000 which would display the last modification date for a table. Not the datetime per record, but the table itself? I'm not looking for a per record date. Hope this makes sense..
 
SQL Server does not store a modified date internally, either for tables or rows.

You need to build this into your table structure, eg add a modified_date column, if you need to store it.

--James
 
Rats.........[curse]

Thanks James for the info...

I have an app. that produces a scheduling report, I was hoping if a date was available to display the last modification date on the report to avoid confusion.

So if I add a date column I would have to updated it within the update program for each record and get the date from the first record. Or am I not understanding you?

 
You could ...

1 - create the Modified_Date column within a table

2a - create an INSERT/UPDATE trigger to update that column
with GetDate() for rows inserted/updated
OR
2b - update the column within your program for rows
inserted/updated

3 - the last modification date for the report
would be Max(Modified_Date) for that table

And, of course, this is per table. Cumbersome, but possible. Good luck!

--Angel [rainbow]
-----------------------------------
Every time I lose my mind, I wonder
if it's really worth finding.
 
Thanks..Angel,

I was trying to avoid that approach but..looks like the only way..

[wavey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top