Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Auto Updation

Author  Topic 

swathigardas
Posting Yak Master

149 Posts

Posted - 2009-01-12 : 08:35:15
Hi,
I really dont know how to start working with it.. so posted here..
There's a Table Called Incident and table Incident Status with the foll columns
Incident_ID Posted_DT Due_Dt Status
1 01/01/2009 01/10/2009 Closed
2 12/10/2008 01/13/2009 Assigned

Incident Status

IncidentId StatusID Status Date
1 1 Open 01/01/2009
1 2 Assigned 01/02/2009
1 3 Assigned 01/05/2009
1 4 Escalated 01/11/2009
1 5 Closed 01/12/2009
2 1 Open 12/10/2008
2 2 Assigned 12/15/2008


Every time current Status will be updated in Incident Table by cross checking with incident Status Table.

The Requirement is if the Due Date in Incident Table is today's date or greater than todays date, Status should be automatically changes to escalated and a new row should be inserted in incident status table with values incident id, status id, status and date - where the status will be escalated.

This has to be automaticallly updated in the database.. How can i achieve this.. Please help me out in this..

Thanks, before hand

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-12 : 08:45:59
seems like what you need is a stored procedure which cjecks this and does the updation in the table.
Go to Top of Page

swathigardas
Posting Yak Master

149 Posts

Posted - 2009-01-12 : 10:32:10
Ya even i thought of Stored Procedure, But the application wont be calling the Stored Proc anywhere. They want the values to be updated at the database end automatically..
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-12 : 10:34:55
quote:
Originally posted by swathigardas

Ya even i thought of Stored Procedure, But the application wont be calling the Stored Proc anywhere. They want the values to be updated at the database end automatically..


that you can do. just configure a sql job to execute the procedure and schedule it
Go to Top of Page

swathigardas
Posting Yak Master

149 Posts

Posted - 2009-01-12 : 10:50:07
Yeah Right.. Thanks for the Suggestion Vishakh
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-12 : 11:14:06
welcome
Go to Top of Page
   

- Advertisement -