WHERE Name LIKE N'[CDW]%' ?

  • SELECT *

    FROM dbo.LIKETest

    WHERE Name LIKE N'[CDW]%';

    What is the function of the 'N' after LIKE.

  • johnbergholm (9/30/2015)


    SELECT *

    FROM dbo.LIKETest

    WHERE Name LIKE N'[CDW]%';

    What is the function of the 'N' after LIKE.

    This is an old post, but it never had a reply because it's on a section that no one checks.

    The N indicates that the string is a Unicode string.

    Here's an example you can run to see the difference (copy and paste):

    SELECT N'?', '?'

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

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

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