Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Nakul Vachhrajani is a Technical Specialist & Systems development professional with iGATE. He holds a MCTS (SQL Server 2008: Implementation & Maintenance)
Browse by Tags · View All
#SQLServer 305
SQL Server 304
Administration 252
DBA 241
T-SQL 234
#TSQL 232
Development 226
Tips 216
Guidance 148
Best Practices 119

Archive · View All
April 2011 14
March 2012 11
December 2011 11
March 2011 11
December 2012 10
October 2011 10
January 2011 10
September 2013 9
January 2013 9
November 2012 9

#0129 - SQL Server – SSMS – Tutorial – Part 04 – Introduction to Database Diagramming (L100)

Jan 26 2012 12:00AM by Nakul Vachhrajani   

For those who have worked in Enterprise environments, documentation is of utmost importance. Documentation can be in the form of a text-based document, or a graphical document (in the form of a diagram).

A data dictionary is a centralized repository of information about data such as meaning, relationships to other data, origin, usage, and format. Data dictionaries are commonly used to circulate copies of the database schema to vendors and technology partners, and once a product is released, this may be made available to the end customers depending upon the need (e.g. to allow for customization or study).

Database diagrams, are a repository of the relationships between the various database objects. Database object relationships are typically described using a graphical representation of the tables, columns, keys, indexes, relationships, and constraints.

For any database, you can create as many database diagrams as you like; each database table can appear on any number of diagrams. Thus, you can create different diagrams to visualize different portions of the database, or to accentuate different aspects of the design. For example, you can create a large diagram showing all tables and columns, and you can create a smaller diagram showing all tables without showing the columns.

Diagram ownership

Database diagrams expose the entire relationship design of a database. This can potentially help someone to reverse engineer the diagrams. Therefore, all diagrams can only be seen by members of the db_owner role.

  1. A diagram can have one and only one owner – the creator of the diagram
  2. The creator of the diagram has to be a member of the db_owner role
  3. A diagram can only be seen by the diagram creator and all members of the db_owner role

Working with database diagrams

A database is not configured to generate and store database diagrams by default. Therefore, before a database diagram is generated, the first task is to prepare the database to enable database diagrams.

  1. Right-click the Database Diagrams node of your database in Object Explorer
  2. Select Yes when prompted if you want to set up database diagramming
  3. Clicking on Yes creates the following objects within the database:
    • Sysdiagrams table
    • sp_alterdiagam stored procedure
    • sp_creatediagram stored procedure
    • sp_dropdiagram stored procedure
    • sp_renamediagram stored procedure
    • sp_helpdiagrams stored procedure
    • sp_helpdiagramsdefinition stored procedure
    • sp_upgraddiagrams stored procedure
    • fn_diagramobjects function

Creating a diagram

Creating a database diagram is now a very easy process, and diagrams can be created in just 4 steps.

  1. Right-click the Database Diagrams node of your database in Object Explorer
  2. From the drop-down menu, click New Database Diagram
  3. In the Add Table dialog box, choose tables to work with in the diagram
  4. The Database Diagram menu will be added to the main menu and the designer pane will open

Here’s a graphical representation of these steps:

Creating a new database diagram Choosing the tables to display Tables added to the diagram

Parts of a diagram

As you can see in the diagram above, there are multiple parts to a relationship between the multiple objects on a database diagram:

  1. Endpoints   The endpoints of the line indicate whether the relationship is one-to-one or one-to-many. If a relationship has a key at one endpoint and a figure-eight at the other, it is a one-to-many relationship. If a relationship has a key at each endpoint, it is a one-to-one relationship
  2. Line Style   The line itself (not its endpoints) indicates whether the Database Management System (DBMS) enforces referential integrity for the relationship when new data is added to the foreign-key table. If the line appears solid, the DBMS enforces referential integrity for the relationship when rows are added or modified in the foreign-key table. If the line appears dotted, the DBMS does not enforce referential integrity for the relationship when rows are added or modified in the foreign-key table
  3. Related Tables   The relationship line indicates that a foreign-key relationship exists between one table and another. For a one-to-many relationship, the foreign-key table is the table near the line's figure-eight symbol. If both endpoints of the line attach to the same table, the relationship is a reflexive relationship

Customizing the diagram

The diagram layout, by default, may not be in a consumable format. The database diagramming wizard allows use to customize the diagram to our convenience.

Zooming

One of the most commonly required features when working with database diagrams is the need to zoom in or out depending upon the number of tables and relationships involved. Simply right-click on the diagram and choose the zoom factor suitable to your needs.

Source view Choosing the zoom factor Post-zoom view
Source View Choosing the zoom factor Post-zoom view

Customizing the amount of information displayed on the diagram

The default view does not provide sufficient information to qualify as a concise, file-able document. To customize the information displayed on the diagram, one can follow the steps below:

  1. Select the tables for which the view needs to be modified
  2. On the “Database Diagrams Designer” toolbar, from the shortcut menu “Table View”, choose the required view
Choosing the required Table View
(The default “Column Names” view in the background)
The default Column Names view
Standard View Standard View
Key Names Key Name View
Table Name Table Name View
Custom View Custom View
Customizing the “Custom View” using the column selector window Customizing a custom database diagram view

Adding text annotation

Often, we may need to add custom notes to the diagram. This is achieved easily by adding a text annotation.

Right-click on any empty area of the screen and choose “New Text Annotation” Creating a new text annotation
A text box comes up and allows us to type in text of our choice. Text Annotated-diagram

Practice Exercises…

It’s time to practice! Very simple exercises today:

  1. Create a database diagram showing all tables of the HumanResources and the Sales schema and also show the relationship between them
  2. Customize the view to show only the keys on the tables
  3. Use the “auto-arrange” functionality to arrange the tables on the designer
  4. Show the relationship names on the diagram

Further reading

  1. Working with Database Diagrams
  2. Designing Database Diagrams

Until we meet next time,

Be courteous. Drive responsibly.

Subscribe to my posts via E-mail: Subscribe here | Read my posts via your favourite RSS reader: Click Here! | Tweet to @nakulv_sql

Tags: Development, Administration, SQL Server, #SQLServer, Guidance, DBA, SSMS, Tools and Utilities, Community, Series,


Nakul Vachhrajani
4 · 36% · 11645
2
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

1  Comments  

  • This comment is waiting for moderation.

    commented on Nov 5 2014 6:21AM
    elraymonds
    3077 · 0% · 2

Your Comment


Sign Up or Login to post a comment.

"#0129 - SQL Server – SSMS – Tutorial – Part 04 – Introduction to Database Diagramming (L100)" rated 5 out of 5 by 2 readers
#0129 - SQL Server – SSMS – Tutorial – Part 04 – Introduction to Database Diagramming (L100) , 5.0 out of 5 based on 2 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]