Comma separated list in SQL
Just a short example of how to write a stored function that returns a comma separated list of values (Microsoft Transact-SQL):
CREATE FUNCION get_authors (@pubId int)
RETURNS nvarchar(max)
WITH EXECUTE AS CALLER
AS
BEGIN
DECLARE @authorList nvarchar(max);
SELECT @authorList = @authorList + ', ' +
authorFirstName + ' ' + authorLastName
FROM pdb_authors a, pdb_publicationAuthors b
WHERE a.authorId = b.authorId AND b.pubId = @pubId;
RETURN(SUBSTRING(@authorList, 3, LEN(@authorList) - 2))
END


I want to host an online Poker Game, and i want to sell usernames and passwords where customers can buy them?
Comment by VPS and dedicated servers — September 4, 2011 @ 04:17