SQL Server Reset Identity Increment for all tables

前端 未结 9 1541
面向向阳花
面向向阳花 2021-01-30 05:38

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

9条回答
  •  春和景丽
    2021-01-30 06:26

    An easy metod may be to use the sp_MSforeachtable command, an undocumented, but relatively well know command that looks over your tables.

提交回复
热议问题