Last active
March 24, 2023 06:55
-
-
Save mukarramjavid/3d5eb921dd159e0835f12d7ca10330b7 to your computer and use it in GitHub Desktop.
From this query you can get comma separated column names in sql server
This file contains hidden or 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 STRING_AGG(COLUMN_NAME,',') AS ColNames | |
FROM INFORMATION_SCHEMA.COLUMNS | |
WHERE TABLE_NAME = N'[table_name]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment