• subscribe
March 22, 2006 12:00 AM

Brush Up on Design Essentials with the SQL Diagrammer

SQL Server's in-the-box data-modeling tool teaches good database design
SQL Server Pro
InstantDoc ID #49263
Downloads
49263.zip

Reporting
Any data-modeling software worth your consideration should have a reporting mechanism. How else can you circulate the work that you've done on the data model? Remember the reasons why you're modeling in the first place: to ensure a good basis for optimum performance, to share a visual representation of the database schema with other people who are invested in the database, and to archive and track changes that are made to the database.

The SQL Diagrammer doesn't have a reporting facility. Instead, you simply use the Generate SQL Script feature of SQL Server 2000 Enterprise Manager or the Generate Script feature of SQL Server 2005 Management Studio and combine the script with a printed copy of the data model.

To create the script, from the Enterprise Manager or Management Studio tree, highlight the database, right-click, choose All Tasks > Generate SQL Script (SQL Server 2000) or Tasks > Generate Scripts and follow the Scripting Wizard (SQL Server 2005). Adopt a naming convention for the output file (e.g., Pubs_script_all_objects_2005dec02.sql) which will readily identify what you scripted and when.

Table and column descriptions are stored in the sysproperties table (SQL Server 2000) and in the sys.extended_properties catalog view (SQL Server 2005).You can generate basic data-dictionary reports by using Web listings 2 and 3, which you can download at InstantDoc ID 49100. Run the code in Web Listing 2 to generate table-level and table-plus-column-level descriptive reports from SQL Server 2000. Run the code in Web Listing 3 to generate the same from SQL Server 2005.

No database report is complete without a picture of the data model. I've heard a lot of people complain that they have no control over how the model is laid out, so that when they print the model, a single table artifact is split between two sheets of paper—very inconvenient. It's true that the algorithm that controls how the SQL Diagrammer lays out the artifacts isn't cognizant of where the page breaks will be, but you can manage the breaks manually. Position the cursor over the background canvas, right-click, and choose View Page Breaks. Now you can adjust the artifacts so that splitting of tables is reduced or eliminated.

Learn Modeling Basics
Most databases are large enough and complex enough that you'll want some software assistance to create the data model. In addition, as the database schema changes over time in response to changing business needs, data-modeling software can keep the database schema and the data model synchronized so that you'll always have a picture of what your database looks like.

Modeling software lets you describe and design. If you think that your database needs to be redesigned to enhance performance or meet business requirements, the first thing you have to do is describe it;catalog what you already have to support your arguments for redesign. Once you get the go-ahead and the budget, you can move into designing databases. Or if you're new to data modeling, start with describing so that you can get familiar with how the data model is constructed.

The SQL Diagrammer doesn't do everything; it isn't the most sophisticated modeling tool on the market. When you're talking about modeling software, price and capability go hand-in-hand. Typically, the more you pay, the more functionality you get, and the SQL Diagrammer lacks a lot of features in high-end modeling software. But it's a way to get basic descriptive modeling done with minimal effort.And it's definitely a step above the paper, pencil, and big eraser routine!



ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here