Declare @TmpId Bigint
Declare @Id Bigint
Select @TmpId = Max(Id_Havaleh) From TmpDrugH
Select @Id = Max(Id_Havaleh) From DrugH

IF @TmpId < @Id 
Begin
  Set @TmpId = @TmpId + 1000
  DBCC CHECKIDENT(TmpDrugH, RESEED, @TmpId )
End

