Skip to content

Instantly share code, notes, and snippets.

@mwinckler
Created March 27, 2012 23:31
Show Gist options
  • Save mwinckler/2221476 to your computer and use it in GitHub Desktop.
Save mwinckler/2221476 to your computer and use it in GitHub Desktop.
SQL Server: List column names from table
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