Information schema for a Table

7

Please login or register to vote for this query.

(click on this box to dismiss)

DON'T EDIT THIS QUERY! YOU HAVE LINKED TO IT FROM HERE: http://meta.stackexchange.com/a/2678/158100 REMEMBER?

Quantitative Finance Meta

Q&A about the site for finance professionals and academics

select c.Table_Name
     , case 
       when ##PK:string?id## = c.column_name then concat(c.column_name,' (PK)') 
       else c.column_name 
       end as column_name
     , data_type
     , is_nullable
     , coalesce(CHARACTER_MAXIMUM_LENGTH
             , numeric_precision
             , datetime_precision) as [Length/precision]
 --     ,*
from INFORMATION_SCHEMA.Columns c
where c.table_name = ##table:string?posts##
order by ordinal_position

Enter Parameters

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