Skip to content

Instantly share code, notes, and snippets.

@dkapitan
Created August 14, 2014 15:17
Show Gist options
  • Save dkapitan/2046f5471fa7db61e4f8 to your computer and use it in GitHub Desktop.
Save dkapitan/2046f5471fa7db61e4f8 to your computer and use it in GitHub Desktop.
Parse values into string using XML PATH
DECLARE @column_list nvarchar(2000) = (
SELECT
substring(
(
SELECT ', ' + column_name
FROM dbo.get_columns_types(@database, @schema, @table)
FOR XML PATH ('')
), 2, 2000)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment