Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Quick FK question

Author  Topic 

nomadsoul
Yak Posting Veteran

89 Posts

Posted - 2006-12-05 : 18:11:16
Good day everyone,
Now that I have my tables loaded each with a proper identity column, I want to ask: Is it good sql programming procedure to insert foreign keys into all the tables at once using a stored procedure? Or is it commonly done?

It is better to be prepared and not have an opportunity than to not be prepared and have an opportunity

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-12-05 : 23:28:00
What do you mean by inserting foreign keys? Do you mean to define FK on desired tables?

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

nomadsoul
Yak Posting Veteran

89 Posts

Posted - 2006-12-06 : 11:30:18
Yes, defining fk's. Sorry my reply is so late

It is better to be prepared and not have an opportunity than to not be prepared and have an opportunity
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-12-06 : 11:41:53
In my opinion, you should have complete database schema ready before writing any code. Adding foreign keys on the table in ad-hoc way as and when required is not at all good. So the answer to your question is YES.

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page
   

- Advertisement -