| Author |
Topic |
|
shubhada
Posting Yak Master
117 Posts |
Posted - 2007-03-21 : 08:18:57
|
| I have one string as follow[rule("Total Covered Days",["Covered Days","Process Rule"],["",""]),rule("Flat Rate",["Reimburse Amt","Flat Rate","Process Rule"],["","2",""])I have stored this string in one variable.I want to break this string with "rule" and want to insert into temp table tempList.like as followhere key is IDENTITY column.key List1 [rule("Total Covered Days",["Covered Days","Process Rule"],["",""])2 rule("Flat Rate",["Reimburse Amt","Flat Rate","Process Rule"],["","2",""])I am using following code but it not working.select @Listselect @count = len(@List1)select @count while (@count1 <= @count)begin select @List2 = SUBSTRING (@List1,1,CHARINDEX(',rule',@List1,1)-1) Insert Into tempList values (@List2) select @List1 = rtrim(ltrim(replace(@List1,@List2,''))) select @count1 = len(@List1) select @count1 end plz tell me how i can break this string and insert into table. |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
shubhada
Posting Yak Master
117 Posts |
Posted - 2007-03-21 : 13:37:02
|
| I want to insert the string start from "rule" ,and delimiter should be ,rule.but first charater in the string is [rule so the first record will inserted as it is.but after that i will select the string from ",rule" first string is [rule("Total Covered Days",["Covered Days","Process Rule"],["",""])and second string will berule("Flat Rate",["Reimburse Amt","Flat Rate","Process Rule"],["","2",""])SQLTeam |
 |
|
|
|
|
|