Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 search multiple values in all columns in a databas

Author  Topic 

blessy
Starting Member

6 Posts

Posted - 2011-09-21 : 02:54:52
Hi,
I am doing a matrimonial site. I am in need for a search procedure which
accepts certain keywords
like

Example 1: hindu, agarwal, f, 25 - 30 yrs, delhi
or
Example 2: iyer, female, 25 yrs, good looking

all these information are scattered in different tables.

I wrote a split fn. which performs well.

I got a SearchTable procedure while i browse over this issue.
http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm

it iterates all the tables in the database and returns tablenames which contains the specified string.

But i 've to search and combine all these strings which are in different tables and finally display the results which satisfy all of this cryterias

Blessy K John

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-21 : 05:55:50
why not having a ranking concept and based on matches it produces give it higher of lower rank. then order results in order of rank
For combining strings add a temporary table and populate with results of each search with key to indicate what search found it. finally group records based on facts and sum up keys to get rank.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -