I recently migrated from a PostgreSQL database to a SQL Server database. To switch the data over I had to enable IDENTITY_INSERT. Well come to find out that I get all sorts of strange errors due to duplicate identity values(which are set as primary keys) upon doing an insert in any of the tables.
I have quite a few tables. What would be the easiest way of automatically reseeding the identity of every table so that it is after max(RID)
?
DBCC CHECKIDENT('tablename', RESEED)
https://mcmap.net/q/473028/-dbcc-checkident-reseed-is-new-value-required – Bailable