WHERE (CONTAINS(*, @QS)) Incorrect syntax??

  • In stored procedure this code cheked and work fine

    SELECT *

    FROM tb_table

    WHERE (CONTAINS(*, 'query'))

    bat this:

    DECLARE @QS varchar(100)

    SELECT @QS = 'query'

    SELECT *

    FROM tb_table

    WHERE (CONTAINS(*, @QS))

    make error on checking "Incorrect syntax near '@QS'"

    what wrong????

  • I dont see anything obviously wrong, according to the sample in BOL it would seem to be valid syntax:

    DECLARE @SearchWord varchar(30)

    SET @SearchWord ='Moon'

    SELECT pr_info FROM pub_info WHERE CONTAINS(pr_info, @SearchWord)

    I just tried a variation of that query on one our tables here on the site and it worked fine, with or without the outer set of parens. Do you have any other code in your procedure?

    Andy

  • quote:


    Do you have any other code in your procedure?

    Andy


    It's test procedure, so no other code.

    After installation latest service pack all work.

    thanks.

  • Thanks for the follow up!

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

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

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