SQL primary key constraint although record does not exist
问题 I am getting the following error: Violation of PRIMARY KEY constraint 'PK_ss_student_grade'. Cannot insert duplicate key in object 'dbo.ss_student_grade'. The duplicate key value is (301, 1011, 24801, 33). If I check the table before the insert there are no records with such a primary key. The insert is done through C# code and I made sure that the code runs only once. even after the error if I check the table I still get no record with such a primary key. Note: a trigger runs on the insert