I have an Entity with a Guid column as the primary key.
Its default is (newsequentialid()). So if I pass NULL it will generate the Guid.
Now I use this database with BDC Model Stuff. The problem is that this auto generated code doesn't pass NULL for the ID with new objects on creation, instead it uses probably just new Guid() which is 00000000-0000-0000-0000-000000000000. So my default constraint is not working and I get a primary key constraint violation error...
So is it possible to catch this problem with a trigger? Maybe check first if the Id is 0000...0 and then generate a valid one?
Pass
Guid.NewGuid()which generates a valid Guid.