read out the SQL table structure

Source: Internet
Author: User
Select object_name (c.id) as table name
, C.name as field name
, T.name data type
, c.length length
, C.prec as Precision
, P.value as Field description
, M.text as defaults
, case when c.status=0x80 then 1 else 0 end identity
, c.iscomputed whether the column's flags have been computed
, c.isnullable whether null values are allowed
, c.isoutparam whether to output parameters
From syscolumns C
INNER JOIN systypes T on C.xusertype=t.xusertype
Left join Sysproperties p on c.id=p.id and c.colid = P.smallid
Left join syscomments m on c.cdefault=m.id
where OBJECTPROPERTY (c.id, ' isusertable ') =1 and object_name (c.id) = ' Dat_deptinfo '



Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.