I thought that the second SET IDENTITY_INSERT would automatically set the TblA1 property off. But it actually gives an error.
SET IDENTITY_INSERT TblA1 ON;
SET IDENTITY_INSERT TblA2 ON;
I was kinda confused because setting both options to OFF or any table to OFF for that matter doesn't show any error message as in:
SET IDENTITY_INSERT TblA1 OFF;
SET IDENTITY_INSERT TblA2 OFF;
So thanks for that question as it may be really useful to know when building some complex scripts. I know, we shouldn't mess with identity values anyway. 😀
Andre Guerreiro Neto