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

I just found a grate tutorial for the MySql.
What it does we’ll create a query to get the all column names of a given table in ms sql server. It’s quite easy. Let’s 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


More Details

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.