Click here to Skip to main content
Click here to Skip to main content
Go to top

List SQL Server table column name as rows

, 2 May 2012
Rate this:
Please Sign up or sign in to vote.
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

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Chamila Ranasinghe
Software Developer
Sri Lanka Sri Lanka
No Biography provided

Comments and Discussions

 
Questionchange in to three tier PinmemberMember 952733622-Oct-12 2:31 
GeneralThoughts PinmemberPIEBALDconsult3-May-12 11:41 
GeneralRe: Thoughts [modified] PinmemberChamila Ranasinghe3-May-12 17:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 3 May 2012
Article Copyright 2012 by Chamila Ranasinghe
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid