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 |
|
dreamaboutnothing
Starting Member
47 Posts |
Posted - 2004-10-29 : 22:38:23
|
| Hi,i have a table with data like thiscolumn1|column2|column3|12 |AB |xyz|90 |cg |dfg|88 |df |ghj|My output should look like this 12+'/'+AB+'/'+xyz+'::' +90+'/'+cg+'/'+dfg+'::'+third recordcolumn is separated by / and record is separated by ::These values will not be fixed values.There can be 10 to 15 records.How should i do it without a cursor.Any help will be appreciated. Thanks |
|
|
kselvia
Aged Yak Warrior
526 Posts |
Posted - 2004-10-29 : 23:24:39
|
| Try this:declare @output varchar(8000)select @output = coalesce(@output+'::','') + column1+'/'+column2+'/'+column3 from mytableselect @output--KenI want to die in my sleep like my grandfather, not screaming in terror like his passengers. |
 |
|
|
dreamaboutnothing
Starting Member
47 Posts |
Posted - 2004-10-29 : 23:35:15
|
| Hi Ken,It did work! Wow, You are great! Thank You so much. |
 |
|
|
|
|
|