'Magic' ERD generator MySQL, MS SQL - mysql

I haven't managed to find a specific answer to this question which works for me, but maybe i'm misunderstanding one or two key points.
I am trying to create a data migration policy for a project where 3 systems (2 X MySQL, 1 X MS SQL) are being consolidated into 1 new system (MS SQL).
To help visualize this problem i want to create Entity Relationship Diagrams for each database. I know how to reverse engineer each database to a sql script, and i know that programs like MySQL Workbench and SQL server management studio have tools which allow you to create diagrams.
My question is: Is there any way to create the diagrams automatically? I.e. somehow analyse foreign keys and detect which field(s) in table A link to table B and insert links in the diagram between the correct fields?

SQL Server Management Studio comes with a diagramming tool. In the Object Explorer, expand your database, then right click on Database Diagrams. You can view and create new FK relationships in there.

I have just realised that the databases i am testing with do not have foreign key constraints set up properly. So i guess the answer is yes, there are ways you can create these diagrams automatically but the foreign keys must be configured.

Related

tool for checking mysql relations?

I designed a MYSQL Workbench ERM with many forign keys relations etc.
I noticed that my ERM had some faults, because if I try to generate models automatically with it, it says that I have got some faulty relations.
Now is my question :
Is there any tool for checking these relations or forign keys , because Workbench ERM Designer can't do this, also if I export the script and Import it to a MYSQL Database there is no Error shown

sql 2008r2 can I copy a diagram from database to database and retain relationships

My objective is to get relationships from database A to database B. Please note I can not do a backup and restore, this is not an option.
These three sets of relationships are in three diagrams and having never copied a diagram from A to B before I was thinking that, if I did this the relationships may also come over. The copy went great, simply moving the records from a.sysDiagrams to b.sysDiagrams was easy.
But no relationships came across, damn. What is the best method to copy diagrams including the relationships from A to B?
A fair amount of time was put into creating these. We often want to move a set of tables from Database to database. Most of the time these are on different servers.
for completeness the comment made by Allan S is the answer to this post. I don't believe I can accept his comment since it was only a comment and not an answer?
I would be very interested to know if there is a way to copy a 2008 SQLServer diagram and include the relationships. I assume there is not.
There are so many option without backup-restore, you can script the diagrams to a .sql file...first check that diagrams list
-- List all database diagrams
SELECT * FROM [SourceDB].[dbo].sysdiagrams
Check similar question :
How to export a SQL Server 2008 Database Diagram to another DB?
Even via visual-Data tool you can :
https://technet.microsoft.com/en-us/library/ms175868%28v=sql.100%29.aspx
Updated
Check this link :
http://forums.asp.net/t/1790223.aspx?Making+ER+Diagram+from+SQL+Server+2008+Database
How do you migrate SQL Server Database Diagrams to another Database?
https://superuser.com/questions/578090/how-to-database-model-in-visio-2013
http://www.codeproject.com/Articles/15080/Script-SQL-Server-diagrams-to-a-file

Mysql workbench not showing realtions after reverse engineering database

I'm using MySQL workbench 5.2.35 CE to reverse a Mysql Database and show the diagram of tables with their relationships.
I am able to get every table and its fields but the relations between them is not shown. Why is that? Is there any way it can be fixed?
Most often, the relations between tables are not stored in the DB. How to combine two tables is entirely up to the SQL query and because there are near endless possibilities to name your columns this is not easy to guess. Try to find some SELECT statements or use brute force to find out wich columns match.
If you are using MyISAM as the database engine, your database is not fully relational. Make your database fully relational by using InnoDB engine. Then you will be able to see the relations when you do reverse engineering. But please note that each has pros and cons of its own. Google MyISAM vs InnoDB to find out more about the differences.
I have tested mysql-workbench for both 5.2 and 6.0 latest version. My database got foreign key constraints defined clearly. My database is using mysql-native SQL. But the relationships are shown as line between tables. I have created another test database with only two tables. In this case the InoDb was used as engine. The foreign key constrain clearly defined. Still it only generate two lonely table object in the ER diagram after going through the "reverse engineering" module.
While using another commercial software, I was able to generate the 'lines' between the Entities.
My question is, is this a problem of workbench itself, or some error on my part. My database server is the latest stable version 5.6.12. If I can get an answer, this will be good for everyone. You don't have to waste time trying to get an ER-diagram with this piece of software.

Determining dependent tables in MySQL?

In MySQL, I need to know which tables depend on other tables. Is it possible to get the relations?
In SQL Server it's possible to see dependent tables. I hope MySQL can do this too.
If it's in pictorical form then that's even better.
Perhaps you want the SHOW CREATE TABLE command?
If there are foreign keys defined, the above command will show you what they are.
Take a look at the information_schema, especially to key_column_usage table.
http://dev.mysql.com/doc/refman/5.0/en/key-column-usage-table.html
Have a look at Database Explorer (object dependency tree) - a unique feature in dbForge Studio for MySQL.
Easily explore object's references and dependants in Database Explorer. Compilation of dependants for debugging is now also available through the object's context menu.
Also, Database Designer can show foreign key relations between tables.
maybe you'd want a graphical front-end to mysql since you're so used to SQL Server. if the foreign keys are defined, it will show up as a link between entities when you reverse engineer the database.

MySQL Workbench - How to synchronize the EER Diagram

I am creating a visual representation of my existing database with MySQL Workbench and I am able to synchronize the models with the "Database -> Synchronize Model..." menu. However, every time I synchronize (update) my model, I have to recreate the EER Diagram and rearrange all the tables. Is there a way to update or synchronize the EER Diagram as well? Thanks.
Database > Synchronize Model...
Choose Stored Connection
Select the Schemata
Choose which to update: Model or Source (in your case, point arrows to Model)
Are you by any chance using a MySQL DB engine that doesn't support foreign keys (e.g. MyISAM?)? Hence, the relations between the tables is not saved on the MySQL server and get lost during synchronization to the workbench.
But I realize this is only the 'why' of your question. I cannot provide an answer that would preserve your arrangement without using an engine that supports foreign keys, e.g. InnoDB.
I was having a variant of this problem--somehow when I would update the model from the database, one of my tables and its corresponding updatable view wouldn't update.
I believe what was happening is that the model was actually updating, but not the diagram. I didn't really make the distinction at first.
Anyway here's how to get the refresh on the E/R diagram:
Delete the nonupdating object(s) from the diagram. (Just right click and choose "Delete".)
Find the objects in the catalog view in the left sidebar.
Drag them back onto the diagram.
Now they should reflect the model (which should reflect the DB if you followed the accepted answer above.)
When I have more than 3 tables to sync, with changes on relations, I changes arrow direction (model <- source), I check "Skip DB changes and update model only" and Execute...
The "Progress of Model and Database Synchronization" window hang with "Apply changes to Model" highlighted. No processor working, nothing move...
I click the X of the window and redo the process again. Clicking the DB, ignore (all), and selecting less tables to update.
v.5.2.44 ce rev 9933
EDIT: Version 5.2.47 correct this bug !!! YĆ© !