I have a script that I need to run that has values that needs to be inserted everywhere there is null values in columns. for this to happen I need to set IDENTITY_INSERT OFF on the entire database. At the end of the script IDENTITY_INSERT needs to be switched on again. Is there a statement that can be used to set IDENTITY_INSERT ON/OFF over an entire datebase or is it only possible to do each table separately?
Share
It isn’t totally clear what you want to do, but as the documentation says, only one table in a session can have
IDENTITY_INSERTon, therefore you cannot disable it on all tables simultaneously. Your script will have to go table by table, setting it off, doing your inserts for that table only and then setting it on again.