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 402,950 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 2,790 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: Programming Forums
Views: 1195 | Replies: 3 | Solved
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  

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MS SQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the MS SQL Forum

All times are GMT -4. The time now is 6:30 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC