| Author |
Topic |
|
wormz666
Posting Yak Master
110 Posts |
Posted - 2008-11-03 : 03:40:08
|
| declare @param varchar(100)declare @pcount numeric(18,0)declare @dum numeric(18,0)declare @dummy varchar(100)declare @gui varchar(100)set @param = 'wewee,wewew,wewewe,'set @pcount = len(@param)set @dum = 1 while (@pcount !=@dum) begin if substring(@param,@dum,1) != ',' begin set @dummy = @dummy + substring(@param,@dum,1) continue end continue end please help me....i want to make a dynamic insert in the stored procedure,i want to separate the value the i send.....please help... |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
wormz666
Posting Yak Master
110 Posts |
Posted - 2008-11-03 : 03:48:37
|
| but i want to all of the object in my table.... |
 |
|
|
wormz666
Posting Yak Master
110 Posts |
Posted - 2008-11-03 : 03:55:49
|
| the comma sign there indicates the number of column will be use...................i want to separated each to the values............. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-11-03 : 03:57:04
|
| Search for Split functionMadhivananFailing to plan is Planning to fail |
 |
|
|
wormz666
Posting Yak Master
110 Posts |
Posted - 2008-11-03 : 04:00:25
|
| i search it on the books online but there are no split function..im using ms sql server 2000 |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-11-03 : 04:04:37
|
| http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=50648MadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-03 : 04:09:16
|
it will split the comma seperated value to individual value.see belowdeclare @param varchar(100)set @param = 'wewee,wewew,wewewe,reg,ewrgtr5,dfbtyb6u7j7,rbhy6jhu6j,rtby6bhy64nu6,scr4g5tgh5yh67j'select * from dbo.ParseValues(@param,',')toutput------------------------------------ID Val----------- ----------------------------1 wewee2 wewew3 wewewe4 reg5 ewrgtr56 dfbtyb6u7j77 rbhy6jhu6j8 rtby6bhy64nu69 scr4g5tgh5yh67j |
 |
|
|
wormz666
Posting Yak Master
110 Posts |
Posted - 2008-11-03 : 04:11:42
|
| thank you for the info.....ill try it at home |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-03 : 04:17:43
|
quote: Originally posted by wormz666 thank you for the info.....ill try it at home
ok. try and let us know how you got on... |
 |
|
|
wormz666
Posting Yak Master
110 Posts |
Posted - 2008-11-03 : 04:26:54
|
| will i create a function or its is existing on the ms sql server 2000??........ |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-11-03 : 04:42:31
|
quote: Originally posted by wormz666 will i create a function or its is existing on the ms sql server 2000??........
You have to createMadhivananFailing to plan is Planning to fail |
 |
|
|
|