I am running a sql script to try and create a FK in a table.
I am using this script
ALTER TABLE employee
ADD FOREIGN KEY (JobNum)
REFERENCES Emp_Jobs (JobNum)
but no matter what I do it keeps giving me this error message,
Msg 547, Level 16, State 0, Line 1
The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK__employee__JobNum__023D5A04".
The conflict occurred in database "Colins Main", table "dbo.Emp_Jobs", column 'JobNum'.
Does anyone know what this is and how I can solve it. Thanks
I am using this script
ALTER TABLE employee
ADD FOREIGN KEY (JobNum)
REFERENCES Emp_Jobs (JobNum)
but no matter what I do it keeps giving me this error message,
Msg 547, Level 16, State 0, Line 1
The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK__employee__JobNum__023D5A04".
The conflict occurred in database "Colins Main", table "dbo.Emp_Jobs", column 'JobNum'.
Does anyone know what this is and how I can solve it. Thanks