468,242 Members | 1,466 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,242 developers. It's quick & easy.

searching database

deepuv04
227 Expert 100+
Hi,
I have a table Users with the columns say
UserName
FirstName
LastName
City
State
Province
Zip
Country
Location
Title
Gender
GradeLevel
Manager
Ethnicity
Department
Division
Experience
Education
TimeZone etc...

Here my requirement is implementing the search functionality which means, user can type any thing in the search box. if the enter text is matches with any of the above columns that record must be displayed on the front end.

can anybody give me the best approach to implement this functionality, another thing is there will be 100000 + records in the table.


Thanks
Nov 17 '08 #1
3 1004
debasisdas
8,127 Expert 4TB
is that a requirment or you are asking out of curiosity ? it seems you got the idea from search option of some of the online networking sites.
Nov 17 '08 #2
deepuv04
227 Expert 100+
Hi,
This is the requirement I have to implement.
Actually I am trying with the following query but I want a better approach to implement this functionality.

Expand|Select|Wrap|Line Numbers
  1. DECLARE @Str varchar(100)
  2.  
  3. SET @Str = 'Jessica'
  4.  
  5. SELECT  *
  6. FROM   Users
  7. WHERE  
  8.        ( (@Str) like ('%' + FirstName + '%') AND (FirstName is not null) )OR
  9.        ( (@Str) like ('%' + TimeZone + '%') AND (TimeZone is not null) )
  10.  
Thanks
Nov 18 '08 #3
ck9663
2,878 Expert 2GB
I heard of FULL-TEXT search but have not really used it yet. Is that something you can use?

-- CK
Nov 18 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by John | last post: by
4 posts views Thread by donald | last post: by
4 posts views Thread by Michi | last post: by
reply views Thread by Chris Chandler | last post: by
33 posts views Thread by Geoff Jones | last post: by
4 posts views Thread by Jordan S. | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.