SQL字符串前加N是什么意思
SELECT * FROM [dbo].[Info] where [Name] like N'%方'
name字段是用varchar存储的字符串。如果不加N 就查不出来,后来经过搜索发现,加N就是以Unicode方式匹配。varchar存储的是非 Unicode 字符串数据。
一般存中文的话最好采用nvarchar的类型
the N actually stands for National language character set
https://stackoverflow.com/questions/10025032/what-is-the-meaning-of-the-prefix-n-in-t-sql-statements

浙公网安备 33010602011771号