Technical Article

Desc Table

,

This script gives the data structure of a table.

select 
left(table_name, 25) 'Table Name', 
left(column_name, 25) 'Column Name', 
left(Data_Type, 15) 'Data Type', 
Character_Maximum_Length 'Length', 
case Is_Nullable when 'Yes' then 'NULL' else 'NOT NULL' end As 'Null', 
column_default 'Default Value'
from information_schema.columns 
where table_name in ('<table1>', '<table2>', '<table3>')

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating