Hey, Lets say we have a query which generates list of city names as output.
1.India 2.America
Now if we want to make this data look like a CSV i.e.
India,America
then how we will generate it in MS SQL 2000
In 2005I have done this using XM Path
From stackoverflow
-
assuming your query is in a table called Table with a field called Nation:
DECLARE @rval varchar(5000) SELECT @rval = COALESCE(@rval + ',','') + Nation FROM Table SELECT @rvalIf you have India, and America in it...it will return: India,America
0 comments:
Post a Comment