Last post Jan 14, 2016 07:07 AM by wmec
Jan 12, 2016 05:50 AM|inbaa|LINK
IN ms sql i have following requirement .While inserting data into table trigger will send First Email . After 3 hrs Second Email need to send .After 6 hrs third mail need to send .Advice me how to achieve this . When ever data insert into table same thing
Jan 12, 2016 10:05 AM|sajidur|LINK
Create a SQL Job to run it every 3h if some conditions fulfill. The conditions will come from your data insert trgger.
Manage a table when insert your first data. Also save insert time. Then you can manage it easily.
May be you got my point.
Jan 13, 2016 09:07 AM|Weibo Zhang|LINK
>> While inserting data into table trigger will send First Email . After 3 hrs Second Email need to send .After 6 hrs third mail need to send .Advice me how to achieve this . When ever data insert into table same thing should happened.
If you want to send the email for each inserted record regularly, you could try to create a scheduled job in the trigger by using T-SQL according to the following links. If I’m wrong, please let me know and clarify what you want to achieve.
But, I think it’s not a good idea. If you do this, there would be many scheduled jobs when you insert many records. So, I suggest you could just create one scheduled job and let it send emails every 3 hours. At the same time, you could record which records
have been emailed twice, at the next email sending, you could skip them.
Jan 14, 2016 07:07 AM|wmec|LINK
You can have scheduled process to check, every hour, to see when the relevant record has been added. Whenever you see 3 or 6 hours have passed, you do the needed job.