2

I have a SQL table with a 20 to 30 columns that I need to to search. I've set up the free text search so that I can run queries such as:

Select * from dbo.table1 where Contains(*,'asdf');

The problem is I don't know which column actually contains 'asdf' is there a straightforward way to get the specific column(s)?

EDIT

The result I'm looking for would be similar to the following:

Record Number  |   ColumnFoundIn
5                  columnA
100                columnB
244                columnA
250                columnF

The original table has a unique record number for each row, so I would like the record number and then the column where 'asdf' was found.

Alan
  • 140
  • 9
  • Your query is correct to find `'asdf'` string in all the columns, The question is Have you actually created FT Indexes on all these columns ?? – M.Ali Feb 07 '14 at 17:52
  • @M.Ali It sounds like the query itself is already working. I think OP is trying to answer the question *which of the many columns actually satisfied this request*. – Yuck Feb 07 '14 at 17:55
  • Yes, the query works perfectly. I just don't know which column in the row actually contains 'asdf' – Alan Feb 07 '14 at 18:00

0 Answers0