Select Table name = case when. colorder = 1 then D. name else ''end, table description = case when. colorder = 1 then isnull (F. value, '') else'' end, FIELD No. =. colorder, field name =. name, id = case when columnproperty (. ID,. name, 'isidentity ') = 1 then' √ 'else' end, primary Key = case when exists (select 1 from sysobjects where xtype = 'pk' and name in (Select name from sysindexes where indid in (select indid from sysindexkeys where id =. ID and colid =. colid) then '√ 'else' 'end, type = B. name, in bytes =. length, length = columnproperty (. ID,. name, 'precision '), decimal point = isnull (columnproperty (. ID,. name, 'Scale'), 0), allow null = case when. isnullable = 1 then' √ 'else' end, default value = isnull (E. text, ''), field description = isnull (G. [value], '') from syscolumns a left join policypes B on. xtype = B. xusertype inner join sysobjects D on. id = D. ID and D. xtype = 'U' and D. name <> 'dtproperties' left join syscomments e on. cdefault = E. id left join sysproperties g on. id = G. ID and. colid = G. smallid left join sysproperties F on D. id = f. ID and F. smallid = 0
-- Where D. Name = 'table to be query' -- this condition is added if only the specified table is queried.
Order by A. ID, A. colorder
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.