cancel
Showing results for 
Search instead for 
Did you mean: 

Return last updated date for DB

0 Kudos
1,341

Hi How can I return the date a DB was last updated?

In MS (spit) SQL it can be done with

SELECT TOP 1 name, modify_date,
type_desc FROM  sy.sobjects ORDER BY
modify_date DESC

I can see that SQL Anywhere has SysObjects and Type but nothing for the last date modified

View Entire Topic
MarkCulp
Participant

This FAQ may help.

0 Kudos

Mark

Thank you for responding.

I believe that FAQ is to query a specific table. I am attempting to query the DB to see which table was last updated and the date

MarkCulp
Participant
0 Kudos

AFAIK There is no one piece of information that tell you when the database as a whole was last modified but the FAQ is saying that you could query the SYSTAB table and find the times when each of the tables were modified.

For example, extract the timestamp of the last table that was modified and that will be the time that the database was last modified.

checkpoint;
select first last_modified_at
  from sys.systab
 order by last_modified_at desc;

HTH

0 Kudos

Just what I wanted - thank you so much 🙂