What could possibly caused a FK error? I’m inserting an ‘Activity’ record into a database that has a ‘StaffId’ field on (FK with Staff table), I’ve looked for the staffId in question (no white spaces etc.) and it DOES exist. What else can cause an error with a foreign key field?
EDIT: Error:
The INSERT statement conflicted with the FOREIGN KEY constraint
“FK_Activities_Staff”. The conflict occurred in database
“DataWarehouseB”, table “dbo.Staff”, column ‘StaffId’. The statement
has been terminated.
SQL Foreign Key documentation says
Some DBs might also support using a non-unique index as a foreign key reference,