I’m executing a stored procedure, but it always throws this error:
The INSERT statement conflicted with the FOREIGN KEY constraint
“OSFRK_OSUSR_ijq_BANK_ACCOUNT_OSUSR_IJQ_BANKA_CLIENT_CLIENT_ID”. The
conflict occurred in database “BANCDEV”, table
“dbo.OSUSR_IJQ_BANKA_CLIENT”, column ‘ID’.
The table is empty, doesn’t have any rows, what is the cause of it? If I do TOP 1 in the select of the insert the error still occurs.
A foreign key means that the key given must point to a valid record in the ‘foreign’ table, so if it’s empty, that’s a fail. Cannot create a record for a client that does not exist.