If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Foreign Key Constraints

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-15-07, 22:39
paloyme paloyme is offline
Registered User
 
Join Date: May 2007
Posts: 7
Foreign Key Constraints

I'm having trouble setting up my foreign key on my table, maybe I'm doing something wrong.

I am using a database management software, navicat. i have just setup my tables with all the fields and have already identified their respective primary keys, but i havent identified my foreign keys through the navicat yet.

what happens is that, when i try to create my foreign keys, i get an error from navicat that says something about my constraints. and i end up not being able to create my foreign keys.

i might have a system design flaw somewhere, but all i can think of is that maybe you cant use the primary key of a table as a foreign key of another table? because thats what i did.
Reply With Quote
  #2 (permalink)  
Old 08-16-07, 05:31
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
create an index on the foreign key first
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On