Either way, I think there is a flaw in your implementation logic. You should either have origin_server at the primary have a default - or ensure that it is a materialized computed column (this will take a bit more setup, so the default may be best). If the default, in the trigger, check to see if the value is already @@servername and if it is, don't bother with the update.
↧