How to quickly search a NVARCHAR(MAX) FIELD?
Posted on 2011-03-02
The field CellText is NVARCHAR(MAX). When I leave it out of the OR clause, this executes super fast, with it in, it's soooo slow! What can I do? FullTextSearch is on, but I'm not sure how to use it.
DECLARE @Keyword nvarchar( 256 ) = 'maria''s'
DECLARE @Kw nvarchar(258) = '%' + @Keyword + '%'
SELECT * FROM tempdb.dbo.mh_stuff
Title like @Kw
Name LIKE @Kw
CellText LIKE @Kw)