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 |
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2010-02-25 : 04:37:04
|
| I want to apply a loop on a string to get each character one by one...Vabhav T |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-02-25 : 04:40:50
|
you want the char to return in rows ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2010-02-25 : 04:41:33
|
| Try this!declare @string varchar(50)set @string='Testing'while(len(@string)>0)Beginselect left(@string,1)set @string=right(@string,len(@string)-1)EndSenthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
 |
|
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2010-02-25 : 04:45:15
|
| Thanks a lot senthil...Vabhav T |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-02-25 : 04:46:08
|
| declare @string varchar(100)set @string='this is my string'select substring(@string,number,1) as single_character from master..spt_valueswhere type='p' and number between 1 and len(@string)MadhivananFailing to plan is Planning to fail |
 |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2010-02-25 : 04:46:25
|
| Welcome! :)Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-02-25 : 05:19:27
|
quote: Originally posted by vaibhavktiwari83 I want to apply a loop on a string to get each character one by one...Vabhav T
You have already used such a function herehttp://www.sqlteam.com/forums/topic.asp?TOPIC_ID=140365Haven't you?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|