How to reset identity ?

  • I have a table with identity field and several foreign keys. Now I want to reset identity field to start from 1 . In order to clean up the table I can do only delete because foreign keys prevent me from doing truncate table.

    Is there a function , set command or any other method to reset identity without truncating or dropping/recreating a table ?

    Thanks

     

  • Look up DBCC CHECKIDENT.

  • Truncate table will work too.

    Pedro R. Lopez
    http://madurosfritos.blogspot.com/[/url]

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply