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.
| Author |
Topic |
|
Underdog
Starting Member
1 Post |
Posted - 2004-05-03 : 14:52:44
|
problem:(i'll try 2 make it short )i have a table with columns ExpiryDate(date) and Approved(bit) (among others)i need to check if Today() <= ExpiryDateif this is false table has to be updated -> approved has to become 0 AND an e-mail has to be sent(email is also part of my table)now i understand that i need to make a trigger of some sort that checks the ExpiryDate every dayi'm not really that familiar with triggers you seeThnx in advance |
|
|
gwhiz
Yak Posting Veteran
78 Posts |
Posted - 2004-05-03 : 14:57:16
|
| Actually I don't think you'll be able to do this in a trigger. If I understand what you want to do correctly, to once a day run through and update the approved column based on the date compared with ExpiryDate. I would set up a stored procedure to do this and the schedule this in a job to run once a day or more if needed. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-05-03 : 14:58:00
|
| Why do you want to do this in a trigger?Tara |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-05-03 : 14:59:17
|
| Well...the trigger will fire on either an insert, update or a deleteIf you want to run the process once a day, you need to set up a stored procedure and a scheduled job.Brett8-) |
 |
|
|
|
|
|