Created
November 13, 2023 22:17
-
-
Save chadbaldwin/39a8f40e12f83928815b8138afb31610 to your computer and use it in GitHub Desktop.
SQL Server STRING_AGG bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT TOP(100) t.[name], c.TestA, c.TestB | |
FROM sys.tables t | |
CROSS APPLY ( | |
SELECT TestA = STRING_AGG(c.[name], '_') | |
, TestB = STRING_AGG(c.[name], ',') | |
FROM sys.columns c | |
WHERE c.[object_id] = t.[object_id] | |
) c | |
WHERE t.is_ms_shipped = 1 | |
ORDER BY t.[object_id] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
[reserving first comment]