Is there a tool that will show diagrams of my SQL database in real-time? - sql

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??

Related

Automatic/Tool Visualize Database Schema

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.

What is the best way to create and manage global Procs and UDFs in SQL Server?

Let's imagine that I have 2 separate Databases on the same instance of SQL Server.
DB1 is a Database relating to Trading and Position Keeping.
DB2 is a Database relating to market pricing variables.
Both databases have the concept of working with time/date objects and I have created some convenience UDFs. Lets further imagine I build some convenient math functions that I would like to be called from all databases. What is the best way of creating and organising them?
i.e. Should I create the UDFs and SPs in the Master Database? How should I group all my CustomDateTime UDFs, is it best to create something in the Schema so that I replace .dbo with .myDateTime or .myMath?
Suggestions appreciated as I do not like how I currently have placed most of my functions in DB1 and I know that many will be relevant to DB2?
Create a Database Project using Visual Studio (I believe 2008 and 2010 support it). Keep object scripts organized within the project. Check the project and related files into some form of version control software (SVN, git, hg, SourceSafe...).
You should have a DBA or a dedicated person who is responsible for deploying code changes to your production environments. You can configure the database project with pre- and post-deployment scripts that can make this easier to work with.
I can't recommend keeping user-defined objects in master; IMHO you're better off with copies in each database. If you're managing your code as above it won't matter that they're duplicated, since the source is in a single, managed location.

Generate db diagram from any sql statement

I'm using DBArtisan 8.5.5 and it has the ability to generate Database Diagrams using Build Query, it has a nice feature that lets it autojoin, detecting potential relationships on newly added tables to the diagram. So the diagram results into a SQL statement since its a Query Builder after all.
Is it possible to provide an SQL statement in DBArtisan and generate the Database Diagram? In other words, the reverse (give it the SQL to generate the diagram, instead of using diagrams to generate SQL)?
If no such feature, is there a product out there for Sybase DB that will provide said feature?
DbVis is an actionable choice, being open source and powerful - it's got a good amount of extra features aside from the one you need.
If you're willing to pay, Aqua Data Studio is a very complete and intuitive database IDE.
As a middle ground solution, disposing of both a - constantly updated - open source edition, the DBeaver Open Source IDE, and an Enterprise Edition. Both of these also offer what you need, the main differences as of now being interface, SSH algorithm support and SQL debugging framework offered in Enterprise. You can take a deeper look yourself, comparing the Open Source features with the Enterprise ones.

Normalization of an existing SQL database

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.

Using MS Team System 2008 Database Edition

I'm wanting to start source controlling our DBs. I've read a lot of questions here and have found that MS Team System 2008 with Database Edition is what I need. So we get it and we are kind of lost really.
We would like in first place, compare the different DBs we have (DEV, STA and PROD) because we had never done any source control on the DBs, they probably have some differences we would like to solve. I've read that MS Team System 2008 DB Edition could do it, but I think we are not finding how to.
Once we had every DB on the same "state", we would like to create some kind of plan to spread changes from local developers DB to some source control (I think putting the Database Project under SVN will do the job). And then have a way to generate the "change script" to propagate the changes to STA, and then to PROD of course. Any ideas of how to do this?
This probably has been already asked, but I guess I'm not finding anything because I'm not using the correct terms to search.
A link to another SO question or to some article describing how to work with MS Team System 2008 Database Edition and SQL Server 2005 projects will be very welcomed.
Thanks to all
Cheers
The answer to your first question is the schema and data comparison features of Visual Studio Team System - Database Developer. You should have a menu item between Build and Test called Data. Under that data menu are options like "Schema Compare" and "Data Compare" - they are fairly intuitive to use.
The next question is how to use the source control on the databases. Source control should be your one source of truth for schema. When you create your database projects and store them in source control, I would suggest having them mirror production initially. Then you can apply changes to the projects and compare the projects to target environments like dev/QA/prod to identify and script out differences that could be moved to those environments.
EDIT:
I would also highly recommend chapter 8 in the book "Professional Team Foundation Server". That chapter covers usage of Team Edition for Database Professionals for the purposes of managing schemas.