Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 177
  • Last Modified:

help with notification email syntax

i am trying to send an email if this query below has matches.  i get an error.  could you help to make sure i have all single quotes



IF EXISTS (SELECT     1
FROM         legalcontract
WHERE     (expired = 1) AND (Triggerdate >= CONVERT(varchar(10), GETDATE(), 121)) AND (Triggerdate <= DATEADD(day, 90, CONVERT(varchar(10), GETDATE(),
                      121)))
  EXEC msdb.dbo.sp_send_dbmail
  @recipients=N'gbarraza@justmarketing.com'
  ,@body='Message Body'
  ,@subject ='Message Subject'
  ,@profile_name ='JMI'
0
gianitoo
Asked:
gianitoo
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>i get an error
what error?

0
 
answer_meCommented:
Go through this :
http://msdn2.microsoft.com/en-us/library/ms190307.aspx

Also elaborate more on error if you are still not able to solve the issue
0

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now