yes you are rigth,
refernce to the link
-----------------
http://www.sqlservercentral.com/articles/Test+Data/61572/
Using function we can do,
CREATE FUNCTION dbo.fnConcatTest (@SomeID INT)RETURNS VARCHAR(8000) AS BEGIN DECLARE @Return VARCHAR(8000)
SELECT @Return = ISNULL(@Return+',','')+SomeCode FROM dbo.TestData WHERE SomeID = @SomeID ORDER BY RowNum
RETURN @Return
END
but my problem i want the query to get the result as "Role1, Role2, Role3..."
so i can subquery and filter all the records with these roles.
here i my scenario i am not using the stored procedure and function.
is it possible to achieve my requiremt without using function.
-------
Santosh