Skip to content

Instantly share code, notes, and snippets.

@chris-brown
Created December 29, 2014 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chris-brown/560464dd6ae980c8d41a to your computer and use it in GitHub Desktop.
Save chris-brown/560464dd6ae980c8d41a to your computer and use it in GitHub Desktop.
Comma deliminate a collection a data to a singe column
GO
DECLARE @tableName VARCHAR(MAX)
SELECT @tableName = COALESCE(@tableName + ',' ,'') + Name
FROM sys.tables
SELECT @tableName
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment