Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
HiI am trying to create a stored procedure which generates an email when the max (datetime) field in my table dw_t_jobdata is not euqual to today's date ,starttime is the datetime field in table dw_t_jobdata , so i need to write a syntax something likeif the dw_t_jobdata.starttime is not equal to getdate() generate an emailCould anybody please help me writing the if clause here ?Or any suggestions in achieving this other than using an stored procedure ?Thanks in advance Here is my code for generating an email :CREATE PROCEDURE [dbo].[Proc_Job_Monitor]ASBEGIN EXEC msdb.dbo.sp_send_dbmail @profile_name = 'qctreport', @recipients = '****@*****.com', @subject=N'ALERT :: Job Hanged ...' ;ENDGO