Skip to content

Instantly share code, notes, and snippets.

@chris-brown
Created December 29, 2014 13:20
Show Gist options
  • 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