You need the N'' syntax only if the string contains characters which are not inside the default code page.
"Best practice" is to have N'' whenever you insert into an nvarchar or ntext column.
"Unicode string constants that appear in code executed on the server, such as in stored procedures and triggers, must be preceded by the capital letter N. This is true even if the column being referenced is already defined as Unicode. Without the N prefix, the string is converted to the default code page of the database.
This may not recognize certain characters.The requirement to use the N prefix applies toboth string constants that originate on the server and those sent from the client."
Like:
create table mul (lang nvarchar(200))
insert into mul (lang ) values (N'multilingual unicode strings')
insert into mul (lang ) values (N' தமிழ்')
insert into mul (lang ) values (N' 請提供服務的日期進行')
use nVarChar as the column data type.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment