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
 General SQL Server Forums
 New to SQL Server Programming
 error while designing

Author  Topic 

thelastjohn
Starting Member

6 Posts

Posted - 2007-08-22 : 03:31:46
I am new to sql server. Currently i am using sql server 2000. i have created two tables course and student , with course_id and stu_id , as primary key of the respective tables.
Now i am trying to relate them through the diagram , in order to create a relationship between the two. When i try to draw a relationship between stu_id and course_id , i get the following error
error:
Unable to create relationship 'FK_stud_course'.  
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]ALTER TABLE statement conflicted with COLUMN FOREIGN KEY constraint 'FK_stud_course'. The conflict occurred in database 'student', table 'course', column 'course_id'.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-22 : 03:59:39
Most probably you have a course_id in the course table, that is not present in the other table.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -