How to reset Auto Incerement Colum Value as 1 after some Transaction

  • --first delete all data from tables and then reset

    If you want to reset only one table colum then


    DBCC CHECKIDENT('Roles', RESEED, 0)  


    --if you want to reset from 2 3 upto any no then pass this no in query


    exec sp_MSforeachtable @command1 = 'DBCC CHECKIDENT (''?'', RESEED,0)'

    --Reset autoincrement id as 1 of all tables

Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Popular Posts of the Week