What does N in SQLServer mean?

Source: Internet
Author: User
USEmaster; GOSELECTOBJECT_ID (NAdventureWorks. Production. WorkOrder) ASObjectID; what does the GO red N Mean? Plus N indicates that the database is stored in Unicode format. Nstring indicates that string is a Unicode string. The format of the Unicode string is similar to that of a common string,

USE master; go select OBJECT_ID (N 'adventureworks. Production. workorder') AS 'object id'; what does GO red N Mean? Plus N indicates that the database is stored in Unicode format. N 'string' indicates that string is a Unicode string. The format of the Unicode string is similar to that of a common string,

USE master;
GO
SELECT OBJECT_ID (N'Adventureworks. Production. workorder') AS 'object id ';
GO

RedNYesWhatMeaning?

AddNIndicates that the data is stored in Unicode format when stored in the database.
N'String' indicates that string is a Unicode string.

The format of a Unicode string is similar to that of a common stringYesOneNIdentifier (NRepresents the international Language in SQL-92 standards )).NThe prefix must be an uppercase letter. For example, 'michél' is a String constant andN'Michél' is a Unicode constant. Unicode constants are interpreted as Unicode data and do notUseCode Page for calculation. Unicode constantYesSorting rules, mainlyUseTo control comparison and Case sensitivity. Assign the default sorting rules for the current database for Unicode constants unlessUseThe COLLATE clause specifies a sorting rule for it. For each character in Unicode dataUseTwo bytes are stored, and each character in the character data makesUseOne byte for storage.YesFor more information, seeUseUnicode data.

Unicode string constants support enhanced sorting rules.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.