Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To Show/Create Relationship Diagram from Existing CRM Database

Status
Not open for further replies.

Miked811

Programmer
Apr 17, 2005
61
0
0
CA
Hi,

I have been tasked to document/show/create the relationship of all tables in a CRM Database. I generated the script from the entire database (SQL Server 2005) and I can see from the script all the primary/foreign keys and its corresponding constraints of each table. Please see sample script below that I cut and pasted:

Code:
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[RSys_Last_Id]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[RSys_Last_Id](
	[TblName] [varchar](30) NOT NULL,
	[LastIdValue] [binary](8) NULL,
 CONSTRAINT [SRSysLastId] PRIMARY KEY CLUSTERED 
(
	[Table_Name] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END

Now, what I want to see is the Entity Relationship in graphical form.

Is there a way of doing this in SQL Server 2005?

Thanks in advance for your help.

Mike
 
In SQL Server you can create a database diagram, that will include relations between tables.
 
Hi Markros,

I tried that already but the relationship connections are not there. What I need is for it to automatically identify the relationship of all the tables.

Please help me, there more than 150 tables and I need to determine which tables connect or relates to another table.

Thanks
 
If you right click on the empty space in the diagram, you can Show Relationship Labels.

See, if this would be enough for you.
 
Thanks Markos...I'll try it...thank you so much for your help...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top