EnjoySharePoint YouTube Channel

How to get Column names of table in SQL Server 2008?


In this post, we will discuss how to get all the column names of a database table in SQL Server 2008.

Get Office 365 Enterprise E3 Or Business Premium Subscription & Try out all the features

You can also check my previous posts on Update record using Enterprise library in Asp.Net, Implement SQL Server authentication in asp.net and Difference between primary key and foreign key in SQL server.

Below is the query that will retrieve the column names of a table.

select COLUMN_NAME from information_schema.columns
where table_name = ‘CountryMaster’
order by ordinal_position

Check the figure below:

Also if you will run the below query, then you will get some additional details:

select COLUMN_NAME,* from information_schema.columns
where table_name = ‘CountryMaster’
order by ordinal_position

Check out Best Alternative to InfoPath -> Try Now
You May Also like the Following SharePoint Tutorials:

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →