Foreign Keys

  • 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...

  • No mention of trusted FK's? See http://sqlblog.com/blogs/hugo_kornelis/archive/2007/03/29/can-you-trust-your-constraints.aspx Handy to know, especially if you are lumbered with a db that exposes all data through very complex (and poorly performing )views!

  • 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

  • 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,

Viewing 4 posts - 16 through 19 (of 19 total)

You must be logged in to reply to this topic. Login to reply