Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return concatenated string from select statement
Message
From
09/10/2003 03:54:40
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
Return concatenated string from select statement
Miscellaneous
Thread ID:
00836663
Message ID:
00836663
Views:
42
I would like to return a concatenated string from a select statement rather than a series of records.

I realise I can just return a table and then convert it into to string myself, but I wondered if there was a SQL Server way of doing this, that return the string as some sort of scalar value.

at present I would have to do the following

Select myfield from mytable

mystring=''
for i = 1 to reccount
mstring = myfield + chr(13)
move to next record
next i


I am trying to remove the code loop above

Many Thanks
Next
Reply
Map
View

Click here to load this message in the networking platform