Click here to Skip to main content
12,693,244 members (26,865 online)
Click here to Skip to main content
Add your own
alternative version

Stats

66.5K views
2 bookmarked
Posted

List SQL Server table column name as rows

, 2 May 2012 CPOL
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

You may also be interested in...

Comments and Discussions

 
QuestionNot an article Pin
Md. Marufuzzaman9-Feb-15 6:00
mentorMd. Marufuzzaman9-Feb-15 6:00 
Questionchange in to three tier Pin
Member 952733622-Oct-12 3:31
memberMember 952733622-Oct-12 3:31 
GeneralThoughts Pin
PIEBALDconsult3-May-12 12:41
memberPIEBALDconsult3-May-12 12:41 
GeneralRe: Thoughts Pin
Chamila Ranasinghe3-May-12 18:48
memberChamila Ranasinghe3-May-12 18:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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 | Terms of Use | Mobile
Web02 | 2.8.170118.1 | Last Updated 3 May 2012
Article Copyright 2012 by Chamila Ranasinghe
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid