User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 363,801 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,537 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser:

WildCard search in SQL Server 2005?

Join Date: Sep 2006
Posts: 104
Reputation: bhavna_816 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
bhavna_816 bhavna_816 is offline Offline
Junior Poster

WildCard search in SQL Server 2005?

  #1  
May 8th, 2008
I have a table which have person's name as Prefix, firstname, lastname, address as three
different columns.
I want to get all records when fire a query like

SELECT * from Persons where name= 'abcd'

I want such query which can search in all three columns, it means abcd can be in
Prefix, firstname or lastname column.

Actually I have a page in which there are some text boxes which accepts some inputs and
based on that inputs displays matching records in GridView.

Suppose someone entered 'Ind', so my query should find records in all three columns of name.

And if someone entered record in first text box say name and nothing is entered in address text box, then
the records matching with that name with all addresses should get displayed.


How can I do that?

Thanks in advance,
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 11:15 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC