Expression Builder does not have a chr function & I can not get a double quote in the statement

  • I am using the expression builder in a Execute SQL task to build a SQL statement on the fly. The expression builder does not use the CHR, CHAR,ASCII functions. I cannot get it to place a double quote mark into the SQL statement. I have used every combination of single and double quotes. I have tried ["], """, """", """"". I am at a lose.

    The statement below I need double quotes to appear in the final SQL statement where the chr(34) appears in the four locations. Thanks in advance for any help.

    "Exec master.dbo.xp_cmdshell 'blat - -attach " + @ExcelDirectory+ "Incentive_" +

    @EndDate + ".xls -to " + @RecipientList +

    " -from COLODBN1@xxxxx.com -s " + chr(34) + @EmailSubjectText + " for " +

    @StartDate + " Through " + @EndDate + chr(34) & " -body " + chr(34) + @EmailBodyText + chr(34) + " ' "

  • Simply escape the double quote using a backslash.

    e.g. "my \"test\" string"

    will come out as

    my "test" string

  • Will try, Thanks

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

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