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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-06-14 : 07:18:04
|
| Ratan writes "Dear Sir/Madam,I would be very thankful if you can help me how to approach the problem.I kind of like this example set by you."CREATE PROCEDURE usp_finduser@usr_id intASSELECT * FROM USERLISTWHERE usr_id=@usr_idExecute Statement:exec usp_finduser '1'"But my problem is something along the lines of one of the multiple paramaters can be passed to the SP and obtain results.Like"CREATE PROCEDURE usp_finduser@usr_id int@usr123_id int@usr456_id intASSELECT * FROM USERLISTWHERE usr_id=@usr_id ElseSELECT * FROM USERLISTWHERE usr123_id=@usr123_idElseSELECT * FROM USERLISTWHERE usr456_id=@usr456_id"Please help!ThanksRatan" |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-06-14 : 07:56:46
|
| If you are wanting to pass multiple users to the SP, you should search for parsing comma-delimited lists on this forum. It sounds like that's what you want to do.EXEC usp_finduser '1234,14142,123445'Is that correct?MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
|
|
|