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 |
|
magmo
Aged Yak Warrior
558 Posts |
Posted - 2010-03-08 : 02:42:15
|
| hiI would like to pass one parameter into my stored procedure, this procedure could be a string of integers like this..1;2;3;5;8I then need to iterate each integer like this...Select * from mytable where pid = @currentIntegerValueCan someone show how this could be achived if possible? |
|
|
karthik_padbanaban
Constraint Violating Yak Guru
263 Posts |
Posted - 2010-03-08 : 02:53:21
|
| did you mean this.declare @a varchar(20)set @a = '1;2;3;5;8' set @a = replace(@a,';',',')exec('select * from mytable where pid in ('+@a+')')Karthik |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-03-08 : 02:55:36
|
| Also search for Array+SQL Server in google/bingMadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|
|