SQL Script to list all the columns of a table with the Schema Information

SQL Script to list all the columns of a table with the Schema Information

If you are looking for a SQL Script which will display a list of all columns in a table and also the Schema Information, you can use the following Script.

 
SELECT * FROM information_schema.columns where table_name = 'TableName'
 
 
Also if you want the info on all the columns in the entire database from all the tables just use the following Script
 
SELECT * FROM information_schema.columns
 
 
If you want to just know the name of the columns and the data type of the column use the following script:
 
SELECT Column_Name, Data_type FROM information_schema.columns where table_name = 'TableName'