SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Duplicate foreign keys.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Hariarul
Posting Yak Master

India
160 Posts

Posted - 10/30/2006 :  00:08:08  Show Profile  Reply with Quote
Hi all,

SQL server allows to create as many as foreign key constraints on a same table for a same column.

Will this affect the design or performance in anyway ?

Naming the constraint would be a good way to avoid this.But in case if someone has already created, How do I remove the existing duplicate keys ?

======================
For Example , I have 2 tables Author and Book. I could execute the below query n times and create as many as foreign keys I want.

ALTER TABLE Books
ADD
FOREIGN KEY (AuthorID)
REFERENCES Authors (AuthorID)

======================

Thanks is advance,

HHA

DonAtWork
Flowing Fount of Yak Knowledge

2161 Posts

Posted - 10/30/2006 :  08:37:52  Show Profile  Reply with Quote
Why dont you:
1) Try it and find out?
2) Read BOL (Books OnLine) and see what it says about Foreign Key Constraints.

Make sure you backup your database first.

[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000