Empty String Variable Matching To Like Conditions In Sql
I have a SQL Server table containing a nvarchar(max) column. I ran a query to select every row where this column contains the string 'remove'. Amongst the results, I have several r
Solution 1:
My guess is that you have some control character(s) in the string. If the first character is a newline, for example, that may cause the rest not to be displayed.
Try
select item_id, unicode(content)
from objects
where item_id = 100;
This will show the unicode code point for the first character you can see the second character with:
unicode(substring(item, 2, 1))
and so on.
Solution 2:
I think, you should trim the column;
select itemid, LTRIM(RTRIM(content))
from objects
where itemid =100and content like'%remove%'
Post a Comment for "Empty String Variable Matching To Like Conditions In Sql"