DECLARE @MaxId INT SELECT @MaxId = max([Id]) FROM [MyTable] if @MaxId IS NULL SET @MaxId = 0 DBCC CHECKIDENT ('[MyTable]', RESEED, @MaxId)
DECLARE @MaxId INT SELECT @MaxId = max([Id]) FROM [MyTable] if @MaxId IS NULL SET @MaxId = 0 DBCC CHECKIDENT ('[MyTable]', RESEED, @MaxId)