VanillaGranilla

updateAllIdentityValues.sql

Jan 15th, 2015
421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.24 KB | None | 0 0
  1. --reset identity values to 0 if you have deleted a large number of rows and want to reset.  Run again to update to current number of rows
  2.  
  3. USE [DB_NAME};
  4. EXEC sp_MSforeachtable @command1 = 'PRINT ''?''; DBCC CHECKIDENT(''?'', RESEED)'
  5. GO
Advertisement
Add Comment
Please, Sign In to add comment