all groups > sql server programming > march 2004 >
You're in the

sql server programming

group:

Many to many relationships (Design brain teaser)


Many to many relationships (Design brain teaser) Tom Cole
3/2/2004 11:41:06 PM
sql server programming:
Ok, guys...I got a challenge here. I am working with SQL Server

I have a highly normalized transaction database design. Assume that I have 8-12 "fact tables". Some people call them "nouns"...basically, I have alot of tables that maintain entities in my DB

Each of these entities can have 1 or many "Comments". I have a comment table. That table is simple. It has an ID, and a text column

What is the smart way to relate the "Comments" table to all of my fact tables? I am trying to avoid creating a "join table" for EACH of my fact tables. Right now, I have a single "join table", which contains a "CommentID" and a "GUID" (uniqueidentifier). I am assigning every single row in all of my fact tables with a GUID. Unfortunately, that requires that the "GUID" be the primary key of all of my fact tables

Re: Many to many relationships (Design brain teaser) Emanuelle
3/3/2004 1:40:10 AM
have an intermediate table that has the comments id and the name of the
table so you can tell which table you go to.
Or, also have another table with a list of the tables
?

[quoted text, click to view]
have 8-12 "fact tables". Some people call them "nouns"...basically, I have
alot of tables that maintain entities in my DB.
[quoted text, click to view]
tables? I am trying to avoid creating a "join table" for EACH of my fact
tables. Right now, I have a single "join table", which contains a
"CommentID" and a "GUID" (uniqueidentifier). I am assigning every single
row in all of my fact tables with a GUID. Unfortunately, that requires that
the "GUID" be the primary key of all of my fact tables.
[quoted text, click to view]
would be HUGE. What is the smart way to establish a relationship between my
comment table, and all my other tables?

AddThis Social Bookmark Button