Basically I need to reset Identity Increment for all tables to its original. Here I tried some code, but it fails.
http://pastebin.com/KSyvtK5b
Actual code from
Be careful when using this command if your table contains data all your new inserts will result duplicate error
exec sp_MSforeachtable @command1 = 'DBCC CHECKIDENT(''?'', RESEED,1)'
to solve the problem you need to run this after that
exec sp_MSforeachtable @command1 = 'DBCC CHECKIDENT(''?'', RESEED)'
this will reset the seed to the last column identity if the data exists