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

Adding Columns to a Table with a Query in MS SQL

What is FILLFACTOR in SQL Server ?

What is the Bookmark Lookup and RID Lookup in SQL Server ?

Using CASE WHEN in MS SQL

What is RAISEERROR in SQL Server ?