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 |
|
danasegarane76
Posting Yak Master
242 Posts |
Posted - 2007-11-29 : 23:25:50
|
| Hi all, I am retriving a single value from the a sql table using this statementSelect loginname from * where no='1348'Which produces the following result danasekaraneNow I want the outut as d | a | n | a | s | e | g | a | r | a | n | e How can I..Thanks in AdvanceDana |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-11-29 : 23:55:21
|
you want individual character as separate column or row ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-11-30 : 01:28:39
|
quote: Originally posted by danasegarane76 Hi all, I am retriving a single value from the a sql table using this statementSelect loginname from * where no='1348'Which produces the following result danasekaraneNow I want the outut as d | a | n | a | s | e | g | a | r | a | n | e How can I..Thanks in AdvanceDana
Where do you want to show the data?MadhivananFailing to plan is Planning to fail |
 |
|
|
danasegarane76
Posting Yak Master
242 Posts |
Posted - 2007-11-30 : 01:51:56
|
quote: Where do you want to show the data?
I am trying to show the data in Bound field of a DataReport(VB).quote: you want individual character as separate column or row ?
Now I want it in a single value with | inserted between each charters |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-11-30 : 03:26:18
|
you can use substring() to extract individual character and concatenate with the '|' character KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-11-30 : 03:31:36
|
| [code]declare @a varchar(100), @b varchar(200)set @a = 'danasekarane'Select @b = Coalesce(@b + ' | ', '') + substring(@a, number, 1)from master..spt_Valueswhere name is null and number between 1 and datalength(@a)select @b[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
danasegarane76
Posting Yak Master
242 Posts |
Posted - 2007-11-30 : 03:53:55
|
| Thanks Harsh, Even You spoun feeded me, I am struggling this integrating with my code |
 |
|
|
|
|
|
|
|