Navicat Premium Quick Export Database ER diagram and data dictionary

Source: Internet
Author: User

2. Quickly export the database data dictionary:

SQL Server database, generating data dictionary

Use Yourdatabase--Specifies the database goselect table name to generate the data dictionary for= CaseWhen a.colorder=1Then D.nameElse "'End, table description= CaseWhen a.colorder=1Then IsNull (F.value,"')Else "'End, field ordinal=a.colorder, field name=a.name, Logo= CaseWhen ColumnProperty (A.id,a.name,'isidentity')=1Then'√'Else "'end, primary key= CaseWhen exists (SELECT1From sysobjectswhereXtype='PK'and nameinch(SELECT name from sysindexes WHERE indidinch(SELECT indid from Sysindexkeys WHERE ID= a.ID and colid=a.colid )) Then'√' Else "'End, type=b.name, number of bytes occupied=a.length, Length=columnproperty (A.id,a.name,'PRECISION'), number of decimal digits=isnull (ColumnProperty (A.id,a.name,' Scale'),0), allow null= CaseWhen a.isnullable=1Then'√'Else "'end, default value=isnull (E.text,"'), field description=isnull (G.[value],"') 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 syscomments e on A.cdefault=E.id left Join Sys.extended_properties G on a.id=G.MAJOR_ID and A.colid=g.minor_id left join Sys.extended_properties F on d.id=f.major_id and f.minor_id =0--whereD.name='the table to query'--If you query only the specified table, add this condition to order by A.id,a.colorder

Or put the table header assignment in the following:

--data Dictionary Select ( case when A.colorder=1Then d.name ELSE"'END) Table name, A.colorder field ordinal, a.name field name, (case when ColumnProperty (a.ID, A.name,'isidentity') =1Then'√'ELSE"'END) identifier (case when (SELECT COUNT (*) from sysobjects WHERE (the name in (SELECT name From sysindexes WHERE (ID=a.id) and (Indid in (SELECT indid from Sysindexk Eys WHERE (ID=a.id) and (Colid in (SELECT colid FR OM syscolumns WHERE (ID=a.id) and (name=A.name))))) and (Xtype='PK'))            >0Then'√'ELSE"'END) Primary key, B.name type, A.length takes up bytes, ColumnProperty (a.id, A.name,'PRECISION'as length, ISNULL (ColumnProperty (a.id, A.name,' Scale'),0as decimal digits ( case when a.isnullable=1Then'√'ELSE"'END) allow null, ISNULL (E.text,"') Default value, ISNULL (G.[value],"'As field description from syscolumns aleft JOIN systypes b on A.xtype=B.xusertypeinner JOIN sysobjects D on a.id=D.id and D.xtype='U'and D.name<>'dtproperties'Left JOIN syscomments e on A.cdefault=e.idleft JOIN sys.extended_properties g on a.ID=g.major_id and A.colid=G.major_idorder by a.id, A.colorder

Next, export the data dictionary:

First, click Export in the top right corner

Then, select the export format:

Select the exported address and the name of the input file

Reference: https://www.idaima.com/article/3083

MySQL, generating a data dictionary

Use information_schema; SELECT T.table_schema as'Database name', T.table_name as'Table name', T.table_type as'Table Type', T. ENGINE as'Database Engine', c.ordinal_position as'Field Number', C.column_name as'Field name', C.column_type as'Data Type', c.is_nullable as'Allow to empty', C.column_key as'Key Type', C.extra as'Self-increment property', C.character_set_name as'encoded name', c.column_comment as'Field Description'From COLUMNS cinner JOIN TABLES T on C.table_schema=T.table_schemaand C.table_name=T.table_namewhere T.table_schema='MySQL'--Specify the database to generate the data dictionary

Reference: http://www.jianshu.com/p/f491d0d3c503

Navicat Premium Quick Export Database ER diagram and data dictionary

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.