It's recently fallen upon the shoulders of another developer and I to pull information from a database spanning some 669 tables with no useful documentation or accessible experts/DBAs of the database. We're not even exactly sure what all information is locked away in the tables that we can pull from to create our--effectively--reports.
Is there any tool or method of generating a diagram (or any other way) to visualize the information to speed up the process?
I was thinking about a generic SQL tool, but the specific database technology is Sybase.
I have been using Sybase Powerdesigner for reverse-engineering database schemas some years ago. I used it to generate a database diagram of the tables with foreign keys to show the relation between the tables. It supports other databases than Sybase too.
Related
In databases you can define relationships between tables. But what exactly is the use, besides documentation, of making these relationships explicit in a diagram (for example by connecting the keys in SQL server management studio)?
Does it give you any advantage in writing SQL statements? Computation time? Memory usage? Usually you "repeat" the relationship in the join statement. I have the feeling I'm missing something trivial.
Thanks
From the fine manual
You can use Object Explorer to create new database diagrams. Database diagrams graphically show the structure of the database. Using database diagrams you can create and modify tables, columns, relationships, and keys. Additionally, you can modify indexes and constraints.
You asked:
Does it give you any advantage in writing SQL statements?
They can tell you how the datase is structured. That's usually pretty key to understanding it, and reading all the FKs into your head and remembering which table relates to what can be quite the puzzle and even then not actually relate to how the data is used and related in-application
Computation time?
Not quite sure what this means, but the presence or absence of a database diagram won't impact the amount of time your SQL Server spends planning or executing queries
Memory usage?
Not really
Usually you "repeat" the relationship in the join statement
Sometimes; there are ways of joining data without using joins, and presence or absence of FKs or database diagrams have nothing to do with SQLS ability to join data
It might be best to think of DB Diagrams as a visual design aid and tool
I want to create schema model with mapped relations of Sybase database.
Database based on SQL Anywhere 9.
What's the best method?
Could I generate schema model "on the fly" based on database
structure with some auto scan?
Or I should create it manually?
What software I should use, some dedicated by Sybase or some another
tool?
Once when I will create this schema model, how to easy keep it
updated?
I need this schema model, to keep better documentation of the database, because actual database structure is very complicated and database is very very huge.
SAP Sybase Power Designer is a good tool for visualizing, developing and maintaining databases. It supports all the SAP Sybase databases, as well as other commercial RDMBS's (SQLServer, Teradata, DB2, etc).
PowerDesigner
I have a single-table database I inherited and migrated to SQL Server, and then I normalized it by creating, linking, and filling a whole bunch of lookup-type tables that represented items in the main table. I now want to replace those items in the original table with their foreign keys. Am I stuck writing a bunch of queries or UDF's and then a giant INSERT statement to accomplish this, or is there a tool I can use to point at the various fields and have it handle the grunt work for me?
Redgate SQL Refactor comes with a 14 day evaluation period and has a "Split Table" refactoring which sounds like it might do what you need?
The feature is described thus:
Split Table splits a table into two
tables, and automatically rewrites the
referencing stored procedures, views,
and so on. You can also use this
refactoring to introduce referential
integrity tables. You can select this
feature from the context menu in
Management Studio’s Object Explorer.
I have had similar experiences. I once inherited a fairly large database that required serious overhaul to the schema before I would look at it without scorn.
Because the upgrade was fairly significant, I designed an SSIS package to migrate data from the old schema to the new. Lookup activities were helpful to map old text values to the new keys. I kept a script of my old schema and data handy and would repeatedly restore the database in a sandbox and re-migrate until I could satisfy the powers-that-be that the migration was reliable.
I found there was only a moderate learning curve to getting started with SSIS. If the tool is available to you, I recommend giving it a try.
I've created some diagrams of SQL tables using the "Reverse Engineer" feature of Microsoft Office Visio. I like being able to visualize my relational databases in this manner.
However, what I get is just a static document that I can print, e-mail to colleagues, and click widgets on.
Earlier this year, I saw at a demo that the new version of Visual Studio 2010 has a new feature called the "Architect Explorer", which allows developers to view relationships among .net classes on the fly. It has many features for filtering the data that the developer is interested in.
It would be really awesome if I could visually browse my tables and stored procedures and see what is related to what by primary key, foreign key, and referenced in stored procedures. I realize that I'm talking about two entirely different technologies and it's not a perfect analogy, but is there some similar tool that would allow me to visualize tables in my SQL database?
I have seen RedGate SQL Dependency Tracker do this:
SQL Dependency Tracker allows you to dynamically explore all your database object dependencies, using a range of graphical layouts.
If you're already using Visio, you should be able to refresh your database diagrams after they've been reverse engineered from an existing database.
Check out:
About synchronizing database model diagrams with databases
If you have a database model that you
created from an existing database with
the Reverse Engineer W izard, you can
keep the drawing synch ronized with
the database.
Is that what you're looking for??
I'm looking for some sample database data that I can use for testing and demonstrating a DB tool I am working on. I need a DB that has (preferably) many tables, and many foreign key relationships between the tables.
Ideally the data would be in SQL dump format, or at least in something that maintains the foreign key references, and could be easily imported into an RDBMS (MySQL or H2).
The dataset itself doesn't have to be huge (in fact, best if it's not). I thought about using the Stackoverflow Data Dump, but it's only about 5 tables.
What about using the entire Wikipedia database?
I should learn to RTFM- MySQL has a sample database for exactly this kind of thing. It's called Sakila. It's small, but it does have a good number of connected tables. I'm still eager to hear more suggestions though.