All field types, lengths, names of the tables that export the database

Source: Internet
Author: User

SELECT
(case if A.colorder=1 then d.name Else ' end) Table name,
A.colorder Field Ordinal,
A.name Field Name,
B.name field type,
b.length field Length,
G.[value] As Field description
From syscolumns a LEFT join systypes 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 Sys.extended_properties G
On a.id=g.major_id and a.colid = g.minor_id
--where D.[name] <> ' table_desc '--the name of the table you want to view, comment out, view field information for all tables in the current database
--where D.[name] = ' cityhot '-the table name you want to view, comment out, view field information for all tables in the current database
ORDER BY A.id,a.colorder

All field types, lengths, names of the tables that export the database

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.