Hi,
How can I create a string containing all values from a row in a
table(SELECT).
sample:
ID | NAME
--
1 | John -> "1,John"
2 | Alexander -> "2,Alexander"
Thank you,
Roby Eisenbraun MartinsConvert all the column values to a character compatible type and use the
concatenation operator like:
SELECT CAST( id AS VARCHAR ) + ',' +
CAST( name AS VARCHAR ( 30 ) ) + ',' +
..
FROM tbl ;
Anith|||What do you want to do with the string? You can use DTS to export a table or
view to a comma delimited text file.
"Roby Eisenbraun Martins" <RobyEisenbraunMartins@.discussions.microsoft.com>
wrote in message news:BDF4B30A-70E8-4D3C-8D35-7C095D2C167F@.microsoft.com...
> Hi,
> How can I create a string containing all values from a row in a
> table(SELECT).
> sample:
> ID | NAME
> --
> 1 | John -> "1,John"
> 2 | Alexander -> "2,Alexander"
> Thank you,
> Roby Eisenbraun Martins
>sql
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment