SQL Search for Unicode text does not work
Posted on 2014-02-17
I have been trying to search for a Unicode text from a Stored Procedure but search doesn't work. The table has Unicode text that is defined as ntext (I have also tried NVarchar). When I search for a phrase in the table, I just don't get any match. If I use 'Like', I get the whole table as a match.
Here is the kind of search I was trying:
Declare @SearchPhrase NVarchar(max) = N'¿¿¿¿ ¿¿ ¿¿¿¿¿%'
SELECT Text as Verses FROM AB
Where Text like @SearchPhrase
This is how the Table is designed:
CREATE TABLE [dbo].[AB](
[BookNumber] [int] NOT NULL,
[Chapter] [int] NOT NULL,
[Verse] [int] NOT NULL,
[Text] [ntext] NOT NULL
I have also tried nvarchar(max) for Text
Both cases give me all Text in the table, whether the phrase is in Text or not