views:

26

answers:

1

is it possible to tell in which column the search string was found, without having to do it with ifs?

if <searchstring> in column1
    -- do some stuff here
else if <searchstring> in column2
    ...
...

i won't post the exact query, as it is too cryptical and too long, but here's a query which does basically the same

select
    title,
    description
from
    position
where
    CONTAINS( (title, description), '"manager"' )
A: 

You can take help of INFORMATION_SCHEMA.view_name. in this case, like in BOL

SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE IS_NULLABLE = 'NO' ORDER BY DATA_TYPE;

Satya SKJ
what's in this table? the schemas of the tables used for the search, or the columns that were matched?
noobsaibot
-1 This wouldn't help at all. It appears to return the TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, and DATA_TYPE of all non nullable columns in the database.
Martin Smith