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

newby question on database date

Status
Not open for further replies.

youthman

Programmer
Apr 28, 2004
49
US
Is there a way to pull the last date and time that a database was updated? I am new to both Perl and SQL, and I have a script that is designed to update the database with totally new data every morning. (The old data is removed, and the new data is put in its place.) The script then sends me an e-mail to verify that all went well. It has been working for over a year now, the problem is that recently, I have not gotten the e-mails. (Success or error messages!) I can't tell if it is a problem with the update not working, or the e-mail not sending, or just that I am not getting all my e-mails on the e-mail server. Can anyone help?
 
How recently? Could it be something to do with the new year? Have passwords changed?

(BTW-are you using a SQL Server database for this?)

-SQLBill

Posting advice: FAQ481-4875
 
It has nothing to do with passwords, or the new year. I have checked all that already. (Yes, It is a SQL Server Database.) The system was working fine until Jan 14, 2005. I did not receive the e-mail on Sat the 15th or any since then.
 
You can't tell the date a record was last updated or when the record was inserted unless you have some sort of date field in your database storing that info. If you have a log reader application you can read the transaction log to see if the inserts happened. Or you could do the insert manually and see if you get an email. How is the script run? If it is a DTS package or a SQL Server job, you can check the history on the package or job. You can also check the error logs in SQL Server and the operating system logs to see if there was a prpoblem. I suppose in total desperation you could restore a backup from before the 15th to another server and then compare the data to the current data to see if it is different.

Questions about posting. See faq183-874
Click here to learn Ways to help with Tsunami Relief
 
Isn't there anyway that you can check that data has been entered into your database since the 14th? Have you considered puting update/record timestamps on each row?

Is your script running in a job? Is the SQL Service Agent running? Maybe the server has been bounced and your job was not set to restart itself automatically?

mrees
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top