using a trigger to get values from one table into another

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • freefony
    New Member
    • Nov 2008
    • 59

    using a trigger to get values from one table into another

    Am trying to get values from table tscore into table tgrade
    Code:
    CREATE TRIGGER qscore
    ON tscore
    FOR INSERT
    AS
    DECLARE @matno char(13)
    DECLARE @score int
    DECLARE @type char(30)
    IF percent = 100
    BEGIN
    UPDATE tgrade 
    SET quiz = SUM (score) AS "quizscore" FROM tscore
    WHERE type = quiz AND mat_no= @matno
    END
    This is not working pls correct me where am wrong its urgent pls!
    Last edited by pbmods; Feb 10 '09, 11:19 PM. Reason: Fixed CODE tags.
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Why do you need a trigger to do this?

    -- CK

    Comment

    • freefony
      New Member
      • Nov 2008
      • 59

      #3
      what else can i use

      i dont know what else to use if not trigger am a begginer if there re better options please let me know

      Comment

      Working...