none
single quote RRS feed

  • Question

  • Hi all there,

    I know single quote(') can be escaped by put another('') in a literal string, but I come across another format which also works, like this: N' ‘Could Not be Inspected’ can'. You can see they are not single quote on appearance. what is that?

    thanks,

    Sheldon.

    Monday, January 13, 2020 4:25 PM

Answers

All replies

  •  select ascii('‘')
     ,char(145)
    • Marked as answer by sesquipedalian Wednesday, January 29, 2020 9:27 PM
    Monday, January 13, 2020 4:36 PM
    Moderator
  • Hi Sheldon,

    The N stands for "National Character" and it means that the content of the string is Unicode.

    --test it in sql server
    
    select N' ‘Could Not be Inspected’ can'
    
    /*
    
     ‘Could Not be Inspected’ can
    
    */

    The output is the content in N' '.

    Best Regards,

    Lily


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    • Proposed as answer by Lily Lii Wednesday, January 15, 2020 5:34 AM
    Tuesday, January 14, 2020 2:51 AM
  • Hi Sheldon,

    Do the answers above help you? Please feel free to let us know if you have any other question.

    It's so kind of you to mark helpful replies as answers in order to close this thread. By doing so, it will benefit all community members who are having this similar issue.

    Best Regards,

    Lily


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Wednesday, January 15, 2020 5:34 AM
  • thanks Jingyang

    Sheldon

    Wednesday, January 29, 2020 9:29 PM