use master; go select object_id( n 'adventureworks.production.workorder') as 'object id'; go 红色的 n 是 什么 意思? 加上 n 代表存入数据库时以 unicode 格式存储。 n 'string' 表示string是个unicode字符串 unicode 字符串的格式与普通字符串相似,
use master;
go
select object_id(n'adventureworks.production.workorder') as 'object id';
go
红色的n是什么意思?
加上 n 代表存入数据库时以 unicode 格式存储。
n'string' 表示string是个unicode字符串
unicode 字符串的格式与普通字符串相似,但它前面有一个 n 标识符(n 代表 sql-92 标准中的国际语言 (national language))。n 前缀必须是大写字母。例如,'michél' 是字符串常量而 n'michél' 则是 unicode 常量。unicode 常量被解释为 unicode 数据,并且不使用代码页进行计算。unicode 常量确实有排序规则,主要用于控制比较和区分大小写。为 unicode 常量指派当前数据库的默认排序规则,除非使用 collate 子句为其指定了排序规则。unicode 数据中的每个字符都使用两个字节进行存储,而字符数据中的每个字符则都使用一个字节进行存储。有关更多信息,请参见使用 unicode 数据。
unicode 字符串常量支持增强的排序规则。