Created
September 14, 2022 20:06
-
-
Save profiiqus/766c9a4032d6a48c776f645a9876e726 to your computer and use it in GitHub Desktop.
Useful stuff for displaying a column in SQL within a single string, values separated by commas
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
STUFF( | |
( | |
SELECT ', ' + mt.[TextValue] | |
FROM dbo.[MultiSelect] AS ms | |
LEFT JOIN usr.[MonthType] AS mt ON mt.[Ident] = ms.[Value] AND mt.[LanguageID] = @UserLanguageID | |
WHERE | |
ms.[TableID] = at.[ID] | |
AND ms.[FormIdent] = @FormIdent | |
AND ms.[ControlIdent] = @ControlIdent | |
FOR xml path('') | |
), | |
1, | |
1, | |
'' | |
) AS Month, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment