Dave Mendlen
Visual Studio
November 1998
Summary: Examines the use of SQL Server 7.0 and the Visual Studio 6.0 new database diagram tool. (3 printed pages) Covers:
The database diagram is a critical document. It helps developers visualize structures of tables and relationships. One of the first things developers want to do when starting to work on a new project is print the entire database schema. The print out from a complex database can cover an entire wall. Sometimes it's easier to understand a database structure if you look at it by subject area. The database diagram tools enable developers and database administrators (DBAs) to create "windows" into the entire database. For instance, there might be a diagram that consists of only the entities related to customer.
Because these documents are stored in the database, all of the developers on the team can view, edit, or create them (depending on their database permissions). Also, the SQL Server 7.0 DBA will be able to publish, share, and edit schemas with the developers from within the SQL Server 7.0 Enterprise Manager.
More and more, developers have stepped into the role of "virtual DBA." While the production DBA focuses on supporting existing databases, developers need databases to begin development against. Using a local SQL Server database and the Visual Database Tools, developers can visually author proposed database structures. From within the tools, both DBAs and developers can create new tables, indexes, relationships, and all the other expected database objects without writing a single line of Transact-SQL. You can modify existing databases, create new ones, and even experiment with changes to your database without actually modifying the underlying database. DBAs won't need to panic because these tools use SQL Server 7.0 underlying permissions—if developers don't have access to the database, they won't have access with these tools either.
It doesn't matter which language in the Visual Studio lineup you choose; you'll have these tools. When you jump over to SQL Server 7.0 Enterprise Manager, you'll notice that the database diagram is so important that it's now the "cover story" for a database.
Let's walkthrough how to use the Visual Database Tools to integrate database development the development environment. The Visual Database Tools are designed for Microsoft SQL Server 6.5, SQL Server 7.0, and Oracle 7.33+ databases. This feature is enabled in all Visual Studio development environments, but will be illustrated in the Visual InterDev and Visual J++ common development environment.
Figure 1. Creating a new database diagram with the Visual Database Tools
Figure 2. Dragging SQL Server tables onto a new database diagram
Figure 3: Automatically arranging tables in a database diagram
Figure 4. Viewing database relationships by positioning the mouse over the links in the database diagram
Figure 5. Viewing key relationships with the Visual Database Tools
Figure 6. Entering a new table name
Figure 7. Viewing column properties
Figure 8. Creating a SQL script by dragging from the Data View with the Visual Database Tools
Figure 9. Adding the database script to Visual SourceSafe
The database diagram is a critical document that both developers and DBA's should manage. Although we didn't use these tools in the SQL Server 7.0 Enterprise Manager, they are included there as well. Because these documents are stored in the database, all of the developers on the team can view, edit, or create them (depending on their database permissions).