I have a series of stored procedures that grab a list of everyone who has an evaluation coming due in a specific time from the current date, and it sends the person and their supervisor an email. The code uses a temp table populated from a different stored procedure, and then uses a cursor for looping through to send out the emails.
It sends one email to the employee, one to the supervisor, fine and dandy. We have a new HR person, and she would like to receive a copy of the email sent out to the employee, so she's got an on going list of who has received them, for her own nefarious purposes. I added a single block of exactly the same code I use for the employee/supervisor emails, and when it runs the HR person gets -three- copies of the email, not just the one I want her to. I am at a loss for figuring out why on earth this is happening. I was hoping that someone here might be able to help me figure out what's wrong.
I'm attaching the code for the stored procedure with identifying information removed, but everything else intact. (never tried to do this before, hope it works)
It sends one email to the employee, one to the supervisor, fine and dandy. We have a new HR person, and she would like to receive a copy of the email sent out to the employee, so she's got an on going list of who has received them, for her own nefarious purposes. I added a single block of exactly the same code I use for the employee/supervisor emails, and when it runs the HR person gets -three- copies of the email, not just the one I want her to. I am at a loss for figuring out why on earth this is happening. I was hoping that someone here might be able to help me figure out what's wrong.
I'm attaching the code for the stored procedure with identifying information removed, but everything else intact. (never tried to do this before, hope it works)