65.9K
CodeProject is changing. Read more.
Home

List SQL Server table column name as rows

starIconstarIconstarIconstarIconstarIcon

5.00/5 (2 votes)

May 3, 2012

CPOL
viewsIcon

81711

Simple query to get table column name as rows

Introduction

The following script will give table column names as rows. Treat the table name as User:

SELECT COLUMN_NAME 'All_Columns' FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='User' 

Following is the result:

History

  • May 03, 2012: Article created