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

Can a stored procedure mark/lookup if a record has been updated?

Status
Not open for further replies.

handlebars

Technical User
Feb 18, 2003
270
GB
I am trying to work out what is the best way for staff to update HR with new and updated records from an SQL based Helpdesk system.

I have created a basic app for manually searching for new/updated staff and automatically creating an email to relevent department.

What I am now thinking is for a way of "batching" all records so that they can be sent as one message at the end of the day (once they have been cross-referenced against our corporate directory).

What I was thinking was putting an extra date field in the staff table and having this updated with the current date when the record is updated. Then i can run a query for each day, that will bring together all updated records into a table, which can be crossreferenced with a Y/N.

My two key questions are - what is the sp to look if a record has been created/updated?

Any advice would be much appreciated (ie if this sounds like a daft idea!)

Andrew
 
It's a fine idea. The SP would simply return all rows where the DateUpdated > TheLastDateYouRanReport.
-Karl

[red] Cursors, triggers, user-defined functions and dynamic SQL are an axis of evil![/red]
[green]Life's uncertain...eat dessert first...www.deerfieldbakery.com[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top