Created
March 27, 2012 23:31
-
-
Save mwinckler/2221476 to your computer and use it in GitHub Desktop.
SQL Server: List column names from table
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
declare @s varchar(4000); | |
set @s = null; | |
select @s = coalesce(@s + ', ' + column_name, column_name) | |
from information_schema.COLUMNS | |
where TABLE_NAME = 'sb_tmpSamplePAList'; | |
select @s; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment