|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, July 03, 2007 11:06 PM
Points: 3,
Visits: 1
|
|
If you don’t have a key, you don’t have a table! - Joe Celko
It is very nice article which one can easly understand without deep knowlege of MSSQL. Also basic concepts are explained very well !!!!!
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, April 14, 2011 12:01 PM
Points: 6,
Visits: 6
|
|
Good, terse explanation.
The only issue I'd have with it is the use of the terminology "Parent" and "Child" to describe the relationship between the primary key and the foreign key(s) that reference it. In the best methodologies I've seen, the terms "parent" and "child" are reserved for unusual situations where you have things that depend for their existence on other things. An example of this might be a line on an invoice - the invoice must exist for the line to exist, do the invoice would be the "parent" and the line the "child". With dissimilar things, such as drivers and racecars, you'd have two distinct entities that were related by a foreign key, but neither would be the "parent" of the other.
That's terminology, but it avoids confusion.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Sunday, September 16, 2012 3:26 AM
Points: 1,038,
Visits: 443
|
|
Fair comment from Roger. Makes me think actually that the next step for the article would be many-many relationship as many people get that confused
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 4:33 AM
Points: 5,122,
Visits: 20,365
|
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Tuesday, March 20, 2007 12:30 PM
Points: 24,
Visits: 1
|
|
Thank you all for your suggestions!
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Thursday, November 13, 2008 9:13 AM
Points: 499,
Visits: 76
|
|
| To not use FKs in an OLTP with any level of complexity is just plain ignorant. There is no excuse for it, and you will just get badly burned. Amazingly enough, through my career I've had to fight developers, managers, and even other DBAs in order to install FKs on databases! It's incredible. In almost every case, they have grown to see the rewards by catching logic / data problems in testing with the FKs. Not to mention happy customers...
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Monday, January 09, 2012 3:37 AM
Points: 36,
Visits: 352
|
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Tuesday, July 27, 2010 9:23 AM
Points: 30,
Visits: 93
|
|
Hi,
This is really a good article. I had an doubt about that i want to generate the insert statement script for moving the data from one db to another. Nearly 500 tables are there, i want to know how to prioritize the tables list. Becuase each and every tables are internally referenced. Can you please help out to fix the issue
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Wednesday, May 29, 2013 3:36 AM
Points: 54,
Visits: 259
|
|
Hi,
Can you help me out in updating such Foreign Key relationships. In one of my tables, i have a FK relationship refering to my primary key of the same table.
The Table called MacMaster has following columns:
MacID MacName ClusterID
the ClusterID here is a foreign key referencing the MacID(PK) of the same table.
MacID(identity column;PK) MacName ClusterID 1 Mac1 2 2 Mac2 NULL
I was trying to load this table from an another table having following column
MacName ClusterName Mac3 Mac4 Mac4 NULL Mac5 NULL
Kindly suggest me a method to load the above data to MacMaster Table. Finally my MacMaster table should have something like this:
MacID MacName ClusterID 1 Mac1 2 2 Mac2 NULL 3 Mac3 4 4 Mac4 NULL 5 Mac5 NULL
Is this can be achieved through TSql or do i need to create a some kind of front end for it.Kindly Suggest
Regards,
|
|
|
|