Hopefully someone will be able to help me here - I'm nearly there but can't get it right, I'm trying to create a stored procedure that when it runs, it will do a query and then send send an email out for each of the rows that it returns.
If I have a DB with 4 columns (ID, Days, Emailed, Name), I would like the query to do a search and find all the records that are below a certain number of days and the emailed column set at 0 - then for each of the rows returned, send an email with the name column in it - but then for each row sent by email, set the emailed column to 1.
If someone can help, then that would be great. Any more info need, just let me know.
Cheers in advance
SQL Server 2008 R2
October 3, 2010 1:36 PM
October 25, 2013 7:46 PM