The INSERT statement conflicted with the FOREIGN KEY constraint "FK__orders__orderSta__2D27B809". The conflict occurred in database "2kd", table "dbo.order_status", column 'ID'. code example
Example: The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "". The conflict occurred in database "", table ", column
SELECT *
FROM [rpt].ReportLessonCompetency rlc
WHERE NOT EXISTS
(
SELECT 1
FROM [rpt].TraineeGrade tg
WHERE tg.Id = rlc.Grade
)