Skip to main content
Solved

How to keep a table of dates data was last updated?


Forum|alt.badge.img
Hi all,

 

 

FIgured I'd ping this forum before looking elsewhere, but here's a question:

 

 

In an effort to provide data to the enterprise, we'd like to let them know when tables they are pulling were last updated. They will be pulling tables from SQL Server.

 

 

Is it possible to either write or update rows in a 'data status' table, or is there another method out there of creating/providing this data?

 

 

Thanks!!!

 

 

-m

Best answer by takashi

One of possible ways is to add an independent feature flow beginning with a Creator. For example:

 

Creator --> TimeStamper --> SQLExecutor (update "status" table)
View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

10 replies

takashi
Influencer
  • April 25, 2014
Hi,

 

 

The TimeStamper transformer creates a datetime string representing current time. How about writing it to the table when updating the database?

 

 

Takashi

david_r
Celebrity
  • April 25, 2014
Hi,

 

 

another option is to have a "metadata" table that contains the tablename and a timestamp for the last update. Like so:

 

 

 

 

David

Forum|alt.badge.img
  • Author
  • April 25, 2014
David, That metadata table would be perfect - is that created using TimeStamper transformer mentioned by Takashi?

 

 

Thanks to you both!

Forum|alt.badge.img
  • Author
  • April 25, 2014
I've been semi-successful at getting this going.

 

 

What I can't figure out is how to connect the TimeStamper to the 'end of a process', rather than a reader.

 

 

What this means for me right now is I'm able to write the table name (via a constant) and date (via timestamper) to a 'status' table, but because I am connecting it to a reader, I'm writing out a record in the status table for every record in the reader table.

 

 

The question is how to only write 1 record to the 'status' table, as implied in David's answer above, so when the update process is complete, the timestamper takes the table name (from the constant) and the date, and writes *one record* to the status table.

 

 

Thanks!!!

takashi
Influencer
  • Best Answer
  • April 26, 2014
One of possible ways is to add an independent feature flow beginning with a Creator. For example:

 

Creator --> TimeStamper --> SQLExecutor (update "status" table)

Forum|alt.badge.img
  • Author
  • April 28, 2014
Takashi, that worked great! Here's the workflow and the result table...

 

 

 

Thank you all for your help!!! I think this will work great!

Forum|alt.badge.img
  • Author
  • June 13, 2014
Another method is to use the 'SQL Statement to execute after translation' option in the 'advanced' parameters of the writer. Here I can use the following statement to write to the UpdateStatus table I've created:

 

 insert into [GisPlanProd].[sde].[UpdateStatus] (TableName, LastUpdated) values ('BirthData_AllYears', GETDATE());
 This works like a charm!

 


ruby
Participant
Forum|alt.badge.img+2
  • Participant
  • June 19, 2015
how would you bring the last_updated column as first column (Column A).  I have something like that but i like to see the date to be displayed in first column.

Forum|alt.badge.img
  • Author
  • June 19, 2015
Rubal, in the image above, the writer I have called "SQL Table", you should be able to open it up and just re-arrange the columns. You might have to 'drop' and re-create the tables after that...

ruby
Participant
Forum|alt.badge.img+2
  • Participant
  • June 22, 2015
thank you

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings