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 |
|
raghavlyon
Starting Member
5 Posts |
Posted - 2006-05-18 : 15:09:36
|
| Hi, I am trying to use WHILE in SELECT query like CASE. This is just to avoid the cursor so that I can concatenate the result of a column of resluting row into one variable. Is there any way to achieve this with the use of WHILE in SELECT query. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-05-18 : 15:33:40
|
| ???DECLARE @Temp VARCHAR(8000)SELECT @Temp = ''SELECT @Temp = @Temp + MyField + ','FROM MyTable |
 |
|
|
raghavlyon
Starting Member
5 Posts |
Posted - 2006-05-18 : 15:41:37
|
| Thanks |
 |
|
|
raghavlyon
Starting Member
5 Posts |
Posted - 2006-05-18 : 15:56:23
|
| i got the result but now problem is that i cannot declare 'text' variable which is giving me a problem becuase the method which was mentioned by you is good till the size goes to 8000 after that canbnot use.Is there any other way to declare a variable of datatype 'text'. That will be great. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|