Select
(Case when a. colorder = 1 then D. Name else ''end) n' table name ',
A. colorder n' Field Sequence Number ',
A. Name n' field name ',
(Case when columnproperty (A. ID, A. Name, 'isidentity ') = 1 then' √ 'else' 'end) n' ',
(Case when (select count (*)
From sysobjects
Where (name in
(Select name
From sysindexes
Where (ID = A. ID) and (indid in
(Select indid
From sysindexkeys
Where (ID = A. ID) and (colid in
(Select colid
From syscolumns
Where (ID = A. ID) and (name = A. Name) and
(Xtype = 'pk')> 0 then' √ 'else' end) n'primary key ',
B. Name n' type ',
A. length N 'number of bytes occupied ',
Columnproperty (A. ID, A. Name, 'precision ') as N 'length ',
Isnull (columnproperty (A. ID, A. Name, 'Scale'), 0) as N 'decimal ',
(Case when a. isnullable = 1 then '√ 'else' 'end) n' allow null ',
Isnull (E. Text, '') n' default value ',
Isnull (G. [value], '') as n' field description'
From syscolumns a left join policypes B
On a. xtype = B. xusertype
Inner join sysobjects d
On a. ID = D. id and D. xtype = 'U' and D. Name <> 'dtproperties'
Left join syscomments E
On a. cdefault = E. ID
Left join sysproperties g
On a. ID = G. ID and A. colid = G. smallid
Order by object_name (A. ID), A. colorder
You canCodeRun it on the SQL query analyzer. (Of course, you need to open a database)