MS SQL Getting List of All Column Names of a Table

The following code should be run to get the list of all column names and data types of a specified table in MS SQL Server.

SELECT COLUMN_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='{Your Table Name}';


You May Interest

Changing MS SQL Table Name with Query

What are the Events On Default Trace in SQL Server ?

Getting Character Count in MS SQL

What is the Difference Between VARCHAR and VARCHAR(MAX) Datatypes ...

What is Failover Clustering in SQL Server ?