Handle Names

  • I am trying to pass a parameter but the name already has a single quote in between , How should I handle such a situation

    The name is James O'Neil

  • You have to escape it by adding another single quote.

    'James O''Neil'

    You can test it out.

    DECLARE @test-2 NVARCHAR(20)

    SET @test-2 = 'James O''Neil'

    SELECT @test-2


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • Great I see it.

    Guess , I should ask this in some other forum as I am trying to do it in SSRS Hyperlink where its not taking this name as it already has a single quote

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

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