views:

44

answers:

1

Hi all,

I have SQL server 2008 enterprise with a database containing up to 100 tables. I generated a database diagram with all of the tables because I want to get an overview of the database.

My question is : How can I quickly find the diagram I want, are there any search functions regarding to diagram search ?

A: 

In SQL Server the diagrams are stored in the sysdiagrams table, which is created whenever a diagram is created. The table definition is as follows.

CREATE TABLE [dbo].[sysdiagrams](
    [name] [sysname] NOT NULL,
    [principal_id] [int] NOT NULL,
    [diagram_id] [int] IDENTITY(1,1) NOT NULL,
    [version] [int] NULL,
    [definition] [varbinary](max) NULL)

Along with the table, a few stored procedures are also created.

  • sp_alterdiagram
  • sp_dropdiagram
  • sp_creatediagram
  • sp_renamediagram
  • sp_helpdiagramdefinition
  • sp_helpdiagrams
  • sp_upgradediagrams

The sp_helpdiagrams procedure will give you a listing of all the diagrams you currently have.

Garett
thanks for your reply. I pretty much like to locate the graph in the diagram, because one page has so many graphs