Header add

In this article we will learn How To Get All Column Names Of Table In SQL.

In the recent requirement, we need a store procedure that should return a list of all column names, we planned that we can copy-paste and do the work but the challenge is that what to do when there is more than 30-40 field it take too much time.

So we found and implement SQL queries to achieve this, let us understand it by the following example.

Syntax


Example

How To Get All Column Names Of Table In SQL


In the above image, you can see all the columns of the ResumeNotificationLog table.

So let's use this example and make a stored procedure that should return All Column Names Of Table In SQL.


Now the procedure is ready so we can simply execute the procedure with passing the Table Name.

Now you can see the output like below with comma separated columns.

How To Get All Column Names Of Table In SQL


Summary
In this tutorial we discussed How To Get All Column Names Of Table In SQL. If have any question related to this topic then give your feedback.

Post a Comment

Previous Post Next Post