Hi All, I have a strange problem. We have a stored procedure SP1 which is inserting data into a table PD. This procedure is inserting data by joining 2 tables and also it is inserting two variables which are populated in this sp. They are ID and Date fields ID = returned by another SP2. Identity value is returned by this SP based on getdate() Date = getdate() Now, if I see the data in table PD. I am able to see that the highest value of ID is 68054. However, the strange thing is I am able to see many records with ID: 999999. I am unable to find out why the ID value is 999999. This ID column is an Identity column and a PK in another table. Please help me with this issue. Please let me know if I am not clear with my question. Procedure Code: Create Procedure SP1 (@SomeId Varchar(Max) = Null, @OtherId VarChar(Max) = Null) As Declare @ID Int, @Date DateTime Set NoCount On Exec @ID = SP2 -- ID is returned from this SP2. Select @Date = Created From Despatch.PickList Where Id = @PickList If @SomeID Is Not Null Begin Delete From PD Where SomeID In (Select Value From dbo.ufn_Split(@SomeId)) Insert Into PD ( Id, Created, SomeID ) Select @ID, @Date, LD.Id From LD Join LH On LD.LHId = LH.Id Join LI On LD.OLId = LI.Id Where LD.Id In (Select Value From dbo.ufn_Split(@SomeId)) Update LD Set PickDate = @Date, PickNumber = @ID Where Id In (Select Value From dbo.ufn_Split(@SomeID)) End If @OtherId Is Not Null Begin Delete From PD Where LIId In (Select Value From dbo.ufn_Split(@OtherId)) Insert Into PD (IDId, Created, SomeID) Select Distinct @ID, @Date, Null From OL Left Join OH On OL.OrderId = OH.Id Left Join LD On OL.Id = LD.OLId Left Join LH On LD.LHId = LH.Id Where OL.Id In (Select Value From dbo.ufn_Split(@OtherId)) End Update OL Set LS = 50900 Where Id In (Select LIId From PD Where ID = @ID ) Select @ID Set NoCount Off I am assuming that there is some problem with Identity. SP2 is returning @@IDENTITY which @ID in above SP. Just wondered why @ID is 999999 for some records.