select table_name as [Table(Links to Sample Data)], --sam...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Science Fiction and Fantasy

Q&A for science fiction and fantasy enthusiasts

select
  table_name as [Table(Links to Sample Data)], --sample data subquery
  ordinal_position as [Field #],
  column_name as [Column],
  (case
    when data_type like '%varchar%'
      then data_type+'('+cast(character_maximum_length as varchar)+')'
    else
      data_type
      end) + 
      (case when IS_NULLABLE like '%NO%' then ' not null' else '' end)  as [type]
from information_schema.columns
--where table_name like '%Types%' --ⓘuncomment this line to limit to reference tables
order by table_name, ordinal_position

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results