sql - Full text searching refuses to work without quotation marks -
but @ same time, quotation marks break query if substituted in.
i have query:
select * contact1 contains(company, n'aktie')
this returns no results. however, if change query to...
select * contact1 contains(company, n'"*aktie*"')
now results i'm expecting. presume due using asterisk wildcard, although don't understand why quotation marks fix things. in addition, if put code behind stored procedure , pass the exact same parameter, "*aktie*"
, receive error states:
syntax error near '"' in full-text search condition '"'.
why? i'm no sql dev need use full text searching part of current feature, , can't find concrete answers on this.
"aktie" part of swedish word, swedish word should recognized english word breaker.
as per request, code of sproc.
create procedure gr_fulltextsearch @query nvarchar select * contact1 contains(company, @query) go
test code:
exec gr_fulltextsearch @query='"*aktie*"' > syntax error near '"' in full-text search condition '"'. select * contact1 contains(company, n'"*aktie*"') > (result set of contact1)
your stored procedure should this:
create procedure gr_fulltextsearch @query nvarchar(100) select * contact1 contains(company, @query) go
if use (n)varchar
interpreted (n)varchar(1)
, procedure , contains getting '"', hence error message! should adjust value 100 value better suited needs.
see, not disappointing @ all! :-)
Comments
Post a Comment