Query to get the all column names of a given table in ms sql server


In this programming tutorial you will learn the query to get the all column names of a given table in ms sql server. Its quite easy. Lets have a look over the query

--Query to get the all field names of a given table in ms sql server
select column_name from information_schema.COLUMNS 
where table_name='yourtbl_name' 
order by column_name asc

So that's it.
I love your feedback.

0 comments: