• You don't need to test for existing rows: the UPDATE will take care of everything with its WHERE clause.

    If you want to find out which rows has been updated, use the OUTPUT clause. In that syntax, the DELETED.* means that it will output the values in the row before the update occured, which will show you that invoicedate is in fact NULL.

    UPDATE [MPSales].[IT]

    SET invoicedate = DATEADD(DAY,-1,GETDATE())

    OUTPUT DELETED.*

    WHERE invoicedate IS NULL

    -- Gianluca Sartori