Using Substring with ContainsTable

  • Hi there,

    I want to do FulltextSearch on only 500 characters of columns in a table to find employees and companies that use Natural Language processing (NLP)

    Employee table has Employee ID, COmpanyNames, Present jobdescription and Brief description of company and ManagerID(if exists).

    I want to do this

    CONTAINSTABLE(dbo.Employee, (SUBSTRING(JobDescription,1,500),CompanyInfo),'ISABOUT("NLP" weight(.1))',LANGUAGE N'English',1000000) as fti

    But I get an error saying that "Incorrect syntax near '('."

    How can I do this

    Thanks

    MR

  • rash3554 (12/19/2016)


    Hi there,

    I want to do FulltextSearch on only 500 characters of columns in a table to find employees and companies that use Natural Language processing (NLP)

    Employee table has Employee ID, COmpanyNames, Present jobdescription and Brief description of company and ManagerID(if exists).

    I want to do this

    [font="Courier New"]

    CONTAINSTABLE(dbo.Employee,(SUBSTRING(JobDescription,1,500),CompanyInfo),'ISABOUT("NLP" weight(.1))',LANGUAGE N'English',1000000) as fti

    [/font]

    But I get an error saying that "Incorrect syntax near '('."

    How can I do this

    Thanks

    MR

    Take a look at the text I highlighted. I suspect that it's complaining about the fact that you have a substring function followed by a comma and what appears to be another field, all in parentheses. As I'm not familiar with FULLTEXT functions, I'm guessing, but most functions of any kind separate ALL their parameters with just commas, and it appears that the extra parentheses MIGHT be the trouble.

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply