question

neerajdhimansre avatar image
neerajdhimansre asked

Stuff with FOR XML PATH

I have a table which looks like this scale_tag stenVal ABL_C_NML 5 ABL_C_NML 4 ABL_C_NML 5 I want the result set like this scale_tag stenVal ABL_C_NML 5,4,5 i want to achieve this using stuff and for xml path(NOT the datatype for sten value is float)
concatenation
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

You should take a look at this article. http://www.sqlservercentral.com/articles/comma+separated+list/71700/ It explains exactly how to do this. Since you have the float datatype you will need to convert/cast that to varchar.
2 Likes 2 ·
Sean, I think you should turn your comment into an answer so it could be accepted.
1 Like 1 ·

1 Answer

·
seanlange avatar image
seanlange answered
You should take a look at this article. [ http://www.sqlservercentral.com/articles/comma+separated+list/71700/][1] It explains exactly how to do this. Since you have the float datatype you will need to convert/cast that to varchar. [1]: http://www.sqlservercentral.com/articles/comma+separated+list/71700/
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.