Avatar of dsoderstrom
 asked on

Question regarding SQL Query Editor

I am designing a query using the Query Editor in SQL server.
I am querying a table and putting a filter on a nvarchar column.
If I type a value into the filter column, for example '12', the editor changes it to N'12'.  
why is it doing this?  What does the "N" signify?
Microsoft SQL Server 2008

Avatar of undefined
Last Comment

8/22/2022 - Mon
Jim Horn

N (nchar, nvarchar, ntext) signifies Unicode, meaning it handles a larger number of characters then non-unicode, and each character takes two bytes in memory instead of one.

Typically this is needed when dealing with foreign language collations.

>If I type a value into the filter column, for example '12', the editor changes it to N'12'.  
Curiosity overwhelms me ... if you have a column that you'd want to filter on '12', then why is it a character data type as opposed to numeric?

So, can I strip out this N and get the same results?
Jim Horn

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

Okay, thanks for the info Jim
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.