Home Forums SQL Server 2008 T-SQL (SS2K8) Logic problem in "SET [Quantity_Remaining] = [Quantity_Remaining] - 1" RE: Logic problem in "SET [Quantity_Remaining] = [Quantity_Remaining] - 1"

  • briancampbellmcad (10/16/2012)


    Let me make sure I understand this line by line and have each right so far...

    First, isn't the line "WHERE Transaction_Type = 'From Bulk Assignment'"

    correctly referenceing the INSERTED with no additional qualifiers for this line needed?

    No, that'll match all then rows in the table that have a transaction type of 'From Bulk Assignment', regardless of when they were inserted or when they got that value.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass