Code Inspection: Unicode usage in SQL
Configure inspections: Settings | Editor | Inspections
Show intention actions: AltEnter
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, refer to 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.
Place the caret at the highlighted line and press AltEnter or click
.
Click the arrow next to the inspection you want to suppress and select the necessary suppress action.