Link to home
Start Free TrialLog in
Avatar of curtis591
curtis591

asked on

Set Identity_insert <table> on

What I am trying to do is to stop inserts into a table if the Set Identity_insert <table> on command is not run.  I have a situation where we have central tables that replicate out to many remote servers.  We want the keys in these tables to be the same.  We also want the same schema in all the tables so we always no that all the databases are in sync.  We are not using sql server replication to do this but have created our own.  In our replication where update the remote table we Set Identity_insert <table> on before the instert and Set Identity_insert <table> off after the instert.  We want to create triggers on these tables so that a remote site can't update the local table unless Set Identity_insert <table> on was issued.  

Is there a way to query inside the trigger if the Set Identity_insert <table> on for that table has been issued.  
ASKER CERTIFIED SOLUTION
Avatar of BillAn1
BillAn1

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial