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
 General SQL Server Forums
 New to SQL Server Programming
 search in table , more than one Name ?

Author  Topic 

h-hemdan
Starting Member

2 Posts

Posted - 2010-07-15 : 13:51:22
hi , lets say i have Table called Voters like that

ID Name VoterNumber electionplace etc ,
1 nick marly 33 area 1
2 ali ibrahim 47 area 1
3 hesham hemdan 34 area 2

if i have list of names on piece of paper include 10 names and i want to put this names in control such listbox or richtextbox , to contain all entered names , and compare them by the Name column and bring me back the data with the same name

i need opinion of expert to tell me wich is the best way to accomplish that , thank you

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2010-07-15 : 14:01:48
select ID,Name,VoterrNumber,ElectionPlace
from voters
where name= namepassedinfromfrontend

Jim


Soon I believe you'all ask how to pass in multiple names

Everyday I learn something that somebody else already knew
Go to Top of Page

h-hemdan
Starting Member

2 Posts

Posted - 2010-07-15 : 15:08:51
i dont understand what is namepassedinfromfrontend
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-07-16 : 11:27:06
quote:
Originally posted by h-hemdan

i dont understand what is namepassedinfromfrontend


It is the input selected from the listbox

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-07-16 : 11:29:16
Is ths a SQL Server T-SQL Question?

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2010-07-17 : 06:06:23
What is the front- end app you are using?
Typically , either an embedded sql statement or a stored procedure - will accept an input parameter. This will search the relavent tables and return a recordset. The app must invoke functions which grab the recorset\ and move to the presentation layer

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
   

- Advertisement -