Inspectopedia 2024.3 Help

Unicode usage in SQL

Reports string literals that use national characters without the N prefix.

Without the N prefix, the string is converted to the default code page of the database. This default code page may not recognize certain characters. For more information, see nchar and nvarchar (Transact-SQL) at docs.microsoft.com.

Example (Microsoft SQL Server):

SELECT 'abcde' AS a; SELECT N'abcde' AS b; SELECT 'абвгд' AS c; SELECT N'абвгд' AS d;

The SELECT 'абвгд' AS c; does not have the N prefix, the 'абвгд' part will be highlighted.

Locating this inspection

By ID

Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.

SqlUnicodeStringLiteral
Via Settings dialog

Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.

Settings or Preferences | Editor | Inspections | SQL

Last modified: 03 December 2024