Reset Identity column to zero in SQL Server?

前端 未结 6 2298
不知归路
不知归路 2021-02-19 04:36

How can I reset the Identity column of a table to zero in SQL Server?

Edit:

How can we do it with LINQ to SQL ?

6条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-19 04:42

    DBCC CHECKIDENT ( ‘databasename.dbo.yourtable’,RESEED, 0)
    

    More info : http://msdn.microsoft.com/en-us/library/ms176057.aspx

提交回复
热议问题