• Antony Symonds (8/15/2012)


    Would seem I had an empty guid that i never used.. and I can get round that no problem... but I have hit another snag 🙁

    When I try and insert the value I get

    The INSERT statement conflicted with the CHECK constraint "repl_identity_range_D15CCC90_AB85_424C_8043_093A8B1625FF". The conflict occurred in database "GSPRO", table "dbo.tbl_asn", column 'asn_id'.

    Due to managed identity range.. is there anyway to get round this?

    Its an automatically created constraint, created by replication to reduce the risk of duplicate identities across publisher and subscribers. If these rows are meant to be there and are missing then you will be safe to disable the constraint, insert the data and re-enable it.

    --disable the constraint

    ALTER TABLE dbo.tbl_asn NOCHECK CONSTRAINT repl_identity_range_D15CCC90_AB85_424C_8043_093A8B1625FF

    --do something

    --enable the constraint

    ALTER TABLE dbo.tbl_asn CHECK CONSTRAINT repl_identity_range_D15CCC90_AB85_424C_8043_093A8B1625FF