I have a stored procedure that returns multiple rows with 5 columns:
SELECT Travel, ID, Dept, Role, Country
FROM TravelManager
For example, I get:
DName ID Dept Role Country
----------------------------------
Travel 23 HR H USA
Travel 29 MR M AUS
Travel 32 FI M UK
Is there any way for me to send this as comma-separated values as first column is same, I want to send only one row without duplicating names in multiple rows and also send other columns as one row only as coma separated values.
Any thoughts and better way to do this? Also how would I modify my select query?
My first column is stored procedure input, so returning that as well :)
I was thinking of temp table or table variable but how to do if so? Please help