Also how to insert with quotes like ''Mann''ys Pizza''

  • Also how to insert with quotes like  'Mann'ys Pizza'

    Insert Locations

    (L_ID, LocationName,...)

    Values(1023, 'Mann'ys Pizza')

  • Try using QUOTENAME().

  • Like this?

     

    Insert Locations

    (L_ID, LocationName,...)

    Values(1023, QuoteName(Mann'ys Pizza))

  • Even QUOTENAME comes up with the same problem...

    When you want to make a single quote part of the text to be inserted, you have to use two of them side by each...

    INSERT INTO Locations

    (L_ID,LocationName,...)

    Values(1023,'Manny''s Pizza',...)

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Thanks All!

Viewing 5 posts - 1 through 4 (of 4 total)

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