0

I'm try to write a t-sql query like this:

select * from table1 t1
where exists (select * from table2 where CONTAINS(Col1, t1.Col1))

But the error is:

Incorrect syntax near 't1'.

There is a FTI on table2 with Col1 included. It's working fine when I hardcode a value like this:

select * from table2 where CONTAINS(Col1, 'value here')

How do I make this work?

Thom A
  • 88,727
  • 11
  • 45
  • 75
ozo
  • 21
  • 4
  • You can't do this in a join, the `CONTAINS` parameter must be a constant or variable. Annoying, but that's how it is. One possibility is to build a dynamic query of all parameters, see https://dba.stackexchange.com/a/316315/220697 – Charlieface Sep 12 '22 at 14:33
  • Thanks @Charlieface for clarifying. I'll find an alternative solution. – ozo Sep 12 '22 at 23:32

0 Answers0