The right form for a Unicode character string literal is to prefix the literal with a capital N and delimit the literal with single quotation marks; for example, N‘literal’. For a regular character string literal, you just delimit the literal with single quotation marks; for example, ‘literal’. It’s a very typical bad habit to specify a regular character string literal when the filtered column is of a Unicode type, as in the following example.
SELECT empid, firstname, lastname FROM HR.Employees WHERE lastname = 'Davis';
- 3. Filtering and Sorting Data
- from Training Kit (Exam 70-461): Querying Microsoft® SQL Server® 2012
- Publisher: Microsoft Press
- Released: December 2012
When working in unicode data types, the N prevents SQL Server from using resources to execute an implicit conversion.
Share this highlighthttp://www.safaribooksonline.com/a/training-kit-exam/18769/