• Michael R. OBrien Jr (1/2/2013)


    I guess I have never been a fan of triple quoting, I usually use CHAR(39) I find it is a lot easier to read for others:

    SELECT 'O' + CHAR(39) + 'Neal'

    Just a thought, nice article though

    That works and I think makes things a little cleaner, but in this example with dynamic sql you would still need to do this (replace one char(39) in O'Neil with two):

    SET @sql = 'Print ' + CHAR(39) + REPLACE(@quotedvar, CHAR(39), CHAR(39) + CHAR(39)) + CHAR(39)