Ok, here is a strange one. I have a routine that goes through and makes several deletions of old data. Ive had a few people complain about getting the error:
System.Data.SqlClient.SqlException: The DELETE statement conflicted with
the REFERENCE constraint
Looking at my code (im using L2S), i dont see how this is possible. But ok, lets say it is. I ask the customer to send me their DB so i can debug it some, one catch: When i hook it up to my SQL server and run the routine, i get no errors. Everything works & deletes as expected. This is a SQL 2008 Express instance on Win2008 that the DB originally comes from, and I hook it up to a full SQL 2008 instance. Are there any differences that would cause such behavior?
Get the client to grab the sql profiler logs and check what sql is running. Compare this with the data in the tables to verify the constraint.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With