Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 need help with email notify in sql server

Author  Topic 

agastyamahi
Starting Member

33 Posts

Posted - 2014-02-17 : 21:26:26
I have a stored procedure which has 2 parameters @LastUpdateDate and @CurrentDate
I calculate the difference between these two days and store it in another variable called Sub, like this

declare @sub int
select @sub = (datediff(dd,@LastUpdate,@CurrentDate))

If the value of Sub is greater than 0, I want to send an email notification to few people that the cube has not been refreshed since last day.

Can any one tel me how I can achieve this ? I researched about configuring sqldbmail, but that didn't work for me.

Any help would be greatly appreciated

Thanks

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2014-02-18 : 01:43:40
Hi, what do you mean by sqldbmail didn't work for you? What was the problem ?Did you have configuration issues?

I'd consider adding the result in a log table - and then email the result from the log table. That way you have a record - in case the email is lost

http://www.sqlserver-dba.com/2011/01/set-up-database-mail-on-sql-server-2005.html

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
   

- Advertisement -