+ Reply to Thread
Results 1 to 2 of 2

How to pass Column value to Contains or FreeText Functions in SQL

  1. How to pass Column value to Contains or FreeText Functions in SQL

    Hi Folks,

    I have a T-SQL query uses Contains,i have setup the index on my table,My
    Question is: How can i pass column value to contains function in T-SQL,My
    Query as follows:

    SELECT Distinct
    [KW].[displayName]
    ,[KW].[title]
    ,[KW].[mail]
    ,[SG].[mail]
    FROM dbo.Table1 AS KW Left Outer JOIN
    dbo.Table2 AS SG ON KW.Mail= SG.mail
    Where not contains(KW.proxyAddresses,SG.mail)

    The error which i got : incorrect syntax,the contains function doesnt
    recognize the mail column value inb table2.

    In the help,you have to pass either a variable or fixed string,i want to
    pass a column value which is not mentioned on SQL 2000 or 2k5 help.

    waiting for your help.



  2. Re: How to pass Column value to Contains or FreeText Functions in SQL

    You would need to use a cursor solution for something like this.

    "MOUSTAFA ARAFA" wrote in message
    news:50064DB9-84FF-4F04-BB48-C392A18172E5@microsoft.com...
    > Hi Folks,
    >
    > I have a T-SQL query uses Contains,i have setup the index on my table,My
    > Question is: How can i pass column value to contains function in T-SQL,My
    > Query as follows:
    >
    > SELECT Distinct
    > [KW].[displayName]
    > ,[KW].[title]
    > ,[KW].[mail]
    > ,[SG].[mail]
    > FROM dbo.Table1 AS KW Left Outer JOIN
    > dbo.Table2 AS SG ON KW.Mail= SG.mail
    > Where not contains(KW.proxyAddresses,SG.mail)
    >
    > The error which i got : incorrect syntax,the contains function doesnt
    > recognize the mail column value inb table2.
    >
    > In the help,you have to pass either a variable or fixed string,i want to
    > pass a column value which is not mentioned on SQL 2000 or 2k5 help.
    >
    > waiting for your help.
    >
    >



+ Reply to Thread