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.
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!