• Thinking about it, if you do the following type of code

    DECLARE @val INT

    SET @val = (SELECT valid FROM tblx)

    If multiple rows return you will get an error.

    If you however do

    DECLARE @val INT

    SELECT @val = valid FROM tblx

    Then @val will be set to the last valid from tblx that comes thru the buffer.

    Do you have cleanup code that runs at the end of your batch that cleans out items with missing data or maybe you are just getting the last record based on your trigger due to the fact the last record is the last thru the buffer if your code is like the secound example.

    Thsi would explain what you are seeing.