Data dictionary generation tools journey (2): Introduction to the functions and functions of data dictionary generation tools and documentation tools
The previous article introduces the entire architecture and functions. This article will introduce the functions and operations in more detail and will help you understand them with practical examples! (Notice: the next article officially introduces Implementation Principles)
Reading directory
- Start using tools
- Tool Panorama
- Download tool source code
- Learning and using
Go back to the top to start using tools
In daily work, what tools do you use to create tables?
1. Use the new Table function provided by SqlServer, or directly write the Create Table (...) statement. Can it be created in a more convenient way? Is it easy to maintain and learn tables created in this way?
2. Use PowerDesign to create a table, which is intuitive and then export the table creation statement. Simulate a Student information management system, you need to create a Student information table (Student)
Let's take a look at the exported SQL
if exists (select 1 from sysobjects where id = object_id('Student') and type = 'U') drop table Studentgo/*==============================================================*//* Table: Student *//*==============================================================*/create table Student ( Name nvarchar(20) null, Code nvarchar(30) null, Sex bit null, constraint PK_STUDENT primary key ())go
Delete the table before creating the table. (If a gender field is added to the student information table, all the data in the original table has been executed, it is not easy for subsequent maintenance.
3. Can I generate documents that are more commonly used by EXECL or WORD?
Back to Top tool Panorama
1. Data dictionary generation tool
Step 1: Design the table structure in EXECL, PowerDesign, and Word (note: the format of EXECL and WORD tables must be consistent with the template to be correctly generated ). Take a look at the formats of the EXECL and WORD templates.
You can copy the template file from the "test template" under the installer directory and perform the operation.
Let's take a look at how to generate SQL statements using tools.
We first generate a table in the new mode, and then look at the table generated in the modified mode (the automatic identification mode will determine whether the table fields exist in the database, if yes, the change mode is used. Otherwise, the new mode is added)
New Mode SQL
/* --------------------------- Data dictionary generation tool (V2.0) -------------------------------- */goif not exists (SELECT 1 FROM sysobjects WHERE id = OBJECT_ID ('[Student]') BEGIN/* ================================================= =========================================* // * Table: student * // * ============================================= ==================== */create table [dbo]. [Student] ([StudentGUID] uniqueidentifier, [Name] varchar (40), [Code] varchar (40), [Sex] tinyint, primary key (StudentGUID )) declare @ CurrentUser sysnameselect @ CurrentUser = user_name () execute sp_addextendedproperty 'Ms _ description', 'student info table ', 'user', @ CurrentUser, 'table ', 'Student 'execute sp_addextendedproperty 'Ms _ description', 'Student Information guid', 'user', @ CurrentUser, 'table', 'student ', 'column ', 'studentgu' execute sp_addextendedproperty 'Ms _ description', 'name', 'user', @ CurrentUser, 'table', 'student ', 'column ', 'name' execute sp_addextendedproperty 'Ms _ description', 'number', 'user', @ CurrentUser, 'table', 'student ', 'column ', 'code' execute sp_addextendedproperty 'Ms _ description', '0: Male 1: Female ', 'user', @ CurrentUser, 'table', 'student', 'column ', 'Sex 'ENDGO
When the database is executed, a grade field needs to be added to the Student table for subsequent demand changes. We add this field to the previous template.
Use the tool again to switch to the modification mode for generation (Note: You need to connect to the database to modify the mode, and you need to compare and find new fields ). We can see the newly added Grade field, which is now executed in the database.
/* --------------------------- Data dictionary generation tool (V2.0) -------------------------------- */goif not exists (SELECT 1 FROM syscolumns WHERE id = OBJECT_ID ('[Student]') AND name = 'case ') begin alter table [dbo]. [Student] ADD [Grade] varchar (40) declare @ CurrentUser sysname select @ CurrentUser = user_name () execute sp_addextendedproperty 'Ms _ description', 'Year', 'user ', @ CurrentUser, 'table', 'student ', 'column', 'grade 'endgo
To query the table information, highlighted in the red part. The Chinese meaning of the table and field is prompted if you do not move the mouse over it, do you still need to worry about not understanding the meaning of tables and fields? Will subsequent maintenance be more convenient?
2. Document generation tools
We have already created a student information table, and we have another requirement. This time we need to interact with other parts of the company. They need a document for table structure information. What do you do? Or a new employee from your department, how can he quickly understand the entire system?
And learning table structure? The document generation tool can solve your problem.
You can see that the newly created student information table is filtered out through the system and time, and the documents in Word or Html format are exported.
The entire demonstration process is complete. Let's review it. First, we add the student information table to EXECL or WORD, and then generate the table creation statement through the data dictionary generation tool, simulating the scenario where fields need to be added for modification. Later, information needs to be transmitted. At this time, the document generation tool will be used to generate a WORD or HTML version of the database structure design manual, is the transfer more convenient.
This chapter is coming to an end. If you think it is helpful to you, please remember to like it. The next article officially introduces Implementation Details and will show you more knowledge!
Go back to the top tool source code for download
Currently, a total of seven versions have been upgraded and the latest version is available.
Data dictionary generation tool V2.0 Installer |
Latest Installer |
Source code of the data dictionary generation tool |
Latest source code |
Go back to the top
If you have used this tool or want to learn it, join this group to discuss the data dictionary generation tool and make it easier to use it.147425783 QQ Group.
For more information about the data dictionary generation tool, click the data dictionary generation tool topic.
The use of data dictionary generators is urgent
It is best to cut a graph .. Server is the name of the server. If it is local, you can try it with an English dot.
How is the SQL database data dictionary generated?
Tools such as Visio and PowerDesigner support reverse engineering and can generate data models directly.