I have a script which creates an entire database and inserts all records to a few dozen tables. It works great, unless there is some issue during the processing, and a table
EXEC sp_MSforeachtable @command1="SET IDENTITY_INSERT ? OFF"