sql server - FTS Contains string concatenate -


im working on fts , has been stuck in problem.with respect . how concatenate strings inside of contains in sql server 2008?

im trying use contains function of fts , need pass search string either concatenated string or return string scalar function. both options not available in fts.

it not allow concatenate search string inside "contains" clause

select top 10 * dbo.staging_table (nolock) contains(text,n'"pakistan"'+'" lahore"') 

select top 10 * dbo.staging_table (nolock) contains(text,(select dbo.getcitylist()))

second option again unavailable expecting string argument. im using query in view cant declare variable :( please me in resolving issue

you can use table-valued function instead of view.

create function dbo.ftestfts (@str nvarchar(4000)) returns table return (     select top 10 *     dbo.staging_table     contains(*, @str) )  select * dbo.ftestfts(n'"pakistan"' + ' &' + '" lahore"') 

note ampersand in search string.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -