Skip to content

Instantly share code, notes, and snippets.

@aliprogrammer69
Created October 25, 2016 12:52
Show Gist options
  • Select an option

  • Save aliprogrammer69/3e10a63ae565c7f826ce4b35c326bb44 to your computer and use it in GitHub Desktop.

Select an option

Save aliprogrammer69/3e10a63ae565c7f826ce4b35c326bb44 to your computer and use it in GitHub Desktop.
How to concat one cloumn of N Rows To One Column in sql server
SELECT STUFF((SELECT ',' + Username
FROM UserMgmt.[User]
FOR XML PATH('p'), TYPE).value('.', 'NVARCHAR(MAX)'),1,1,'')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment