Column name as second parameter in full-text search CONTAINS or FREETEXT

Is it likely to put a column name instead of a fixed string expression in a sentence CONTAINS()or FREETEXT()full-text search?

I need to use their functionality, but I do not need to hard-code the string expressions, but to check for some values ​​in a certain column.

Basic example:

Two tables, one of which contains some large texts, and the other contains the words that should be in these texts. I also need to find the weight of each incident ...

I need something like

...
WHERE CONTAINS(Column1, Column2)

or

...
WHERE FREETEXt(Column1, Column2)
+4
source share
1 answer

, - :

CREATE PROCEDURE FindSomething 
AS  
BEGIN

  DECLARE @query varchar(...)   
  select @query =  'SELECT [...] WHERE [build me dynamically in cursor]'

  exec (@query) 
END
0

Source: https://habr.com/ru/post/1532637/


All Articles