• dwain.c (12/20/2012)


    vinu512 (12/20/2012)


    dwain.c (12/19/2012)


    Since quote is also CHAR(25), you can also do this:

    CHARINDEX(CHAR(25), string_column) > 0

    Single Quote is char(39) Dwain......if I am not wrong. 😉

    Looked like a single quote when I SELECTed it but then sometimes my eyes aren't so good.

    I can't display CHAR(25) on any of my servers, so it must be foreign 😛

    SELECT N, CHAR(N) AS CharResult

    FROM (SELECT TOP 255

    ROW_NUMBER() OVER (ORDER BY(SELECT NULL))

    FROM master.sys.all_columns sc1

    CROSS JOIN master.sys.all_columns sc2

    )a(N);

    Or, narrowed down to find the single quote: -

    SELECT N, CHAR(N) AS CharResult

    FROM (SELECT TOP 255

    ROW_NUMBER() OVER (ORDER BY(SELECT NULL))

    FROM master.sys.all_columns sc1

    CROSS JOIN master.sys.all_columns sc2

    )a(N)

    WHERE CHAR(N) = '''';

    Yep, CHAR(39). I used it far more than I should due to dynamic SQL :w00t:


    Forever trying to learn
    My blog - http://www.cadavre.co.uk/
    For better, quicker answers on T-SQL questions, click on the following...http://www.sqlservercentral.com/articles/Best+Practices/61537/
    For better, quicker answers on SQL Server performance related questions, click on the following...http://www.sqlservercentral.com/articles/SQLServerCentral/66909/