Difference between comparative database table structure

xiaoxiao2021-04-08  406

It is often encountered in the upgrade. For different users, the table structure of the database sometimes uses will also have some different, and the time is long, and it is often necessary to report the differences between the various versions of the database table structure. What do you do when you need such a report? One more comparison each table of each library, each field of each table, definition, index of each field ... terrible. Is there any good way? I have a semi-automated way to throw the brick.

Prerequisites, there must be MS Visio in your machine. In this software, there is a plot type of [Database-Database Model]. I used it to achieve the difference between the comparative database table structure.

Step 1: Open Visio, create a new database-database model diagram. After the drawing file is opened, select the "database" of the main menu - "Reverse Engineering", at this time, "Reverse Engineering Wizard" will pop up, and the database architecture is extracted from the existing database. Configuring your data source is the database to be compared (generally the old version of the database). By prompt, you will want you to enter your username, password, then let you choose the object type to be reverse engineering. Choose yourself, what kind of database structure you care, choose what is good. OK, next, choose the table and / or view to perform reverse engineering, all choice. Next, here, ask if you want to add a shape to the current page, I suggest you still do not add, no, add shape later. Next, check it out, if you don't have a problem, press it. At this point, the structure of the source database has been created. Save your file.

Step 2: In the source database model diagram file, select "Database" of the main menu - "Refresh Model". At this time, the "Refresh Model Wizard" will be popped, and the original reverse engineering wizard is basically the same, here, please select the database you want to compare (usually a new version of the database), press the prompt, you will want you to enter your username, password , Then ..., start the difference between the current database and the database image stored in the model. Here, there will be a report to you, this report, you can believe, do not have a whole letter, why is it a half-activation method, the reason is here, there is a difference, he will list all, there is no difference Place, he will also list. OK, I have worked hard, according to this report, I will verify myself, and I have an authoritative database structure difference report.

Ok, the difference is reported. How, look more than yourself, more convenient.

You can press this method, two two comparisons, very fast, your total report is completed. However, this method can only compare the table structure. If you have some cured information written in the table, this trick can be used. Write a statement comparison. Lazy words, you will look at your eyes slowly.

If you have something better, please tell me, everyone share it together.

转载请注明原文地址:https://www.9cbs.com/read-132687.html

New Post(0)