Getting Column Names with their Datatype and Size.

Posted by vishalneeraj-24503 under Sql Server category on | Points: 40 | Views : 215
Below query will give us all the Columns with their Type and Size.
SELECT column_name as 'Column_Name',data_type as 'Data_Type',
character_maximum_length as 'Max_Length'
FROM information_schema.columns
WHERE table_name = 'your_table_name';

We can also get Table name,column position,database name and so on.

Comments or Responses

Login to post response