Apostrophe Handling in Dynamic sql

  • I am in a need to create a dynamic sql . But in this script column values contains apostrophes ( ' -: Eg : Reji's ) . I can create the query by temporarly replacing the character . but it will take more time . Without using replace option how to create the sql .

    Thanks in Advance

    Regards,

    Reji P R

  • Either replace the (') with doubles ('')

    or use (" ")

    set QUOTED_IDENTIFIER OFF

    select "Reji's"

  • HI ,

    I guess the first question is, do you have to use dynamic SQL and why?

    Secondly why do you not want to use the REPLACE function?

    Thanks

    Chris

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life

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

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