I have an sp that has the following statements
INSERT INTO stockorderdetails(productid,optionid1value,optionid2value,qtyrec)
VALUES(@productid,@skucolor,@skumodel,@numadded)
SELECT @stockorderdetailsid=@@IDENTITY
SELECT @attributeStockId = dbo.ufn_GetAttributeStockIdFromID (@productid,@skucolor,@skumodel)
UPDATE attributestock
SET numberinstock = numberinstock + @numadded
WHERE id = @attributeStockId
INSERT INTO [dbo].[stockOrderDetailsChanges] (stockOrderDetailsId, qtyrec, prevCost, newCost, userid, attributeStockId)
VALUES(@stockorderdetailsid,@numadded,@cost,@cost,@userid,@attributeStockId)
insert into updatestocklogbyattribute(attributeid,qty)
values(@attributeStockId,@numadded)
Now the strange thing is that I am not getting any error messages and but the middle statmenet is not running (and it's running the statement after it)
this is the statement that sometimes is not running
INSERT INTO [dbo].[stockOrderDetailsChanges] (stockOrderDetailsId, qtyrec, prevCost, newCost, userid, attributeStockId)
VALUES(@stockorderdetailsid,@numadded,@cost,@cost,@userid,@attributeStockId)
the one before it and after is
How can I debug the issue if there are no errors?