From: Erland Sommarskog on
Paul Gibson (sibleypark(a)hotmail.com) writes:
> Fair enough on the dates but I was more referring to the formatting of
> the SQL. In the case were I was updating text into an NVARCHAR column
> type I would be faced with the same challenge. Is there a global
> setting that I can set in SQL to not try to convert strings into the
> codebase of the SQL installation and therefore have the N' perfix
> inferred in all SQL commands? If not I will have to change thousands of
> SQL statements and since each string would have to be examined there
> would be no way that I could do a simple search & replace function.

No. The type of a 'literal' is varchar. The type of an N'literal' is
nvarchar.

This is not really unique to SQL. You have the same issue in C++. A
"literal" is a char[] literal, an L"literal" is a wchar[] literal.

But if you were using parameterised commands, this would be a lesser
issue. Well, if you are not, but embedding literals into your code,
there is all reason to kill two birds with one stone when you go through
the code.

--
Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx