• ktager (7/30/2013)


    Lowell,

    Sorry, didn't see your inserted code? Would using the INSERTED table get the trigger to fire each time?

    basically, we are updating the current table from INSERTED, so that we limit the affected rows to only those in teh update, and not every row in the table.

    :

    UPDATE [dbo].[StudentID]

    SET [FoodBarcode] = [dbo].[StudentID].[AI] + 3289,

    [LibraryBarcode] = [dbo].[StudentID].[AI] + 880101800707

    FROM INSERTED --INSERTED and DELETED are virtual tables, inside a trigger, with the new/old values

    WHERE [dbo].[StudentID].[AI]= INSERTED.[AI] --[AI] is the identity of the table/PK

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!