November 30, 2009 at 5:43 am
I have a data warehouse that is refreshed on a nightly basis. I want to be alerted if any records appear after each data refresh that have a field in a table equal to a specific value. Seems a bit extreme to set up an ssrs report or do something in ssis to check. Is there a better way of doing this? I would imagine I'm being a little dull here and not seeing the obvious!
November 30, 2009 at 6:56 am
How about a sql agent job that runs after the refresh that checks for the value and sends an email using database mail if the value exists. Your job could have something like this in it:
If exists(Select 1 from table where column = [value])
Begin
Exec msdb.dbo.sp_send_dbmail @recipients = [your email], @subject = 'Value Found',
@Body = 'Value found in table. Please fix'
End
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
November 30, 2009 at 8:35 am
Hey, I like that! Haven't used sp_send_dbmail before and it's worked fine. Thanks.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply