sp_send_dbmail - Quotes in mail id

  • I have to send mail from SQL 2008 to an id James.T'Cooper@zzzzz.com

    Since the id has quotes ('), am getting syntax error. How to resolve this?

  • balasach82 (12/11/2012)


    I have to send mail from SQL 2008 to an id James.T'Cooper@zzzzz.com

    Since the id has quotes ('), am getting syntax error. How to resolve this?

    Add in the CHAR(39) keyword where the ' goes

    So 'James.T+'CHAR(39)+'Cooper@zzzzz.com'

    Or 'James.T''Cooper@zzzzz.com'

  • Anthony,

    Thanks. Let me try both the ways and get back to you on how it went.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply