Would you tell me, please, when should I use N prefix before string in Transact-SQL query? I have started to work with a database where I don't get any results using query like this
SELECT * FROM a_table WHERE a_field LIKE '%а_pattern%'
until I change pattern to N'%а_pattern%'
. I never had to add this prefix in the past, so I am curious. a_field
is defined as nvarchar(255)
, but I think the reason is something else.