SQL Server 2000 Constraints

0 pts.
Tags:
DataCenter
Hello! Can anyone help me with regards to a contraint that is a foreign key? I have several tables that all need to reference another table, so the several tables all have a foreign key constraint: ALTER TABLE tblOne ADD CONSTRAINT FK_ForeignKeyID FOREIGN KEY (the_referenced_id) REFERENCES tblReferencedTable(the_referenced_id) Should I create the above constraint for each table I need it applied to, or can I just create the constraint and then add it to each table? Many thanks to anyone who can help.
ASKED: January 26, 2005  7:43 PM
UPDATED: February 8, 2005  1:29 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Addition of foreign keys in any rdbms is a DDL (data definition language) command, and thus needs to be specified for each table with an :
‘alter table ‘ command.

That is the only way to add a foreign key.

Regards:

Ferenc

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following