Click here to Skip to main content
15,895,011 members
Home / Discussions / Database
   

Database

 
GeneralRe: join tables form two odbc datasources Pin
ToddHileHoffer13-Jul-05 10:36
ToddHileHoffer13-Jul-05 10:36 
GeneralGetRows Pin
DaveHuber12-Jul-05 9:59
DaveHuber12-Jul-05 9:59 
GeneralRe: GetRows Pin
Christian Graus12-Jul-05 13:38
protectorChristian Graus12-Jul-05 13:38 
GeneralAccess Database Problem Pin
liza ray12-Jul-05 9:20
liza ray12-Jul-05 9:20 
GeneralRe: Access Database Problem Pin
Jean-Marc Arzoumanian22-Jul-05 12:15
Jean-Marc Arzoumanian22-Jul-05 12:15 
GeneralUpdate database by dataset Pin
rushing12-Jul-05 0:40
rushing12-Jul-05 0:40 
GeneralAbout jobs under Management Pin
hakanaktan11-Jul-05 21:52
hakanaktan11-Jul-05 21:52 
QuestionHow can I use @param in a select*where... Pin
Member 138216011-Jul-05 16:37
Member 138216011-Jul-05 16:37 
D'Oh! | :doh:
Hi all thanks for reading. I am kinda new to stored procedures and need a bit of help. I am calling a stored procedure which I send 2 parameters, lets say @first_name and @column_name.
I am using a
SELECT * FROM members WHERE @column_name = @first_name
but when I run the procedure I get no results.

Is this valid? MS VS.net allows it and runs the procedure but I get no return?
if I alter the procedure to say
SELECT * FROM members WHERE first_name = @first_name
I get the desired results

Here is my stored preocedure

ALTER Procedure DBSearch (@first_name varchar(40), @column_name varchar(40))
as

select * from members where @column_name = @first_name;

RETURN


Thanks in advance for any help


BigJRags
AnswerRe: How can I use @param in a select*where... Pin
Yulianto.11-Jul-05 16:48
Yulianto.11-Jul-05 16:48 
GeneralRe: How can I use @param in a select*where... Pin
Member 138216011-Jul-05 16:58
Member 138216011-Jul-05 16:58 
GeneralRe: How can I use @param in a select*where... Pin
Yulianto.11-Jul-05 17:01
Yulianto.11-Jul-05 17:01 
GeneralRe: How can I use @param in a select*where... Pin
Member 138216011-Jul-05 17:15
Member 138216011-Jul-05 17:15 
GeneralRe: How can I use @param in a select*where... Pin
Yulianto.11-Jul-05 17:19
Yulianto.11-Jul-05 17:19 
GeneralRe: How can I use @param in a select*where... Pin
Edbert P11-Jul-05 17:09
Edbert P11-Jul-05 17:09 
GeneralRe: How can I use @param in a select*where... Pin
Member 138216011-Jul-05 17:16
Member 138216011-Jul-05 17:16 
AnswerRe: How can I use @param in a select*where... Pin
Rob Graham16-Jul-05 12:44
Rob Graham16-Jul-05 12:44 
GeneralSQL DTS Pin
vrkanth11-Jul-05 14:21
vrkanth11-Jul-05 14:21 
GeneralODBC Dialog Pin
Jmuwanga11-Jul-05 1:08
sussJmuwanga11-Jul-05 1:08 
GeneralURGENT:- ODBC connection string problem to access a remote SQL server Pin
Zalak10-Jul-05 20:02
Zalak10-Jul-05 20:02 
GeneralRe: URGENT:- ODBC connection string problem to access a remote SQL server Pin
Albert Pascual11-Jul-05 9:17
sitebuilderAlbert Pascual11-Jul-05 9:17 
GeneralXML Output spread over multiple rows Pin
totig10-Jul-05 19:41
totig10-Jul-05 19:41 
GeneralSqlDmo Pin
mahakhalid10-Jul-05 0:16
mahakhalid10-Jul-05 0:16 
GeneralRe: SqlDmo Pin
Mbat11-Jul-05 3:31
Mbat11-Jul-05 3:31 
Generalsql query Pin
Anonymous9-Jul-05 21:29
Anonymous9-Jul-05 21:29 
GeneralRe: sql query Pin
Colin Angus Mackay9-Jul-05 21:34
Colin Angus Mackay9-Jul-05 21:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.