Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2003
    Location
    France
    Posts
    21

    Unanswered: trigger question

    Hi,
    my SQL Server DB is filled through an Access interface.
    when a table (myTable) is filled (insert) I want a trigger to be fired and insert some values in another table (otherTable).

    myTable.ID is an interger with automatic incrementation (identity).
    I don't know how to retrieve this value to insert it in the otherTable.myID

    here is some code:

    CREATE TRIGGER myTable_Trigger1
    ON myTable
    AFTER INSERT
    AS
    INSERT INTO otherTable
    (myID, ohterField)
    VALUES (????, 'some value')

    thanks for your help

  2. #2
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    how about:

    CREATE TRIGGER myTable_Trigger1
    ON myTable
    AFTER INSERT
    AS
    INSERT INTO otherTable (myID, ohterField)
    select ID, 'some value' from inserted
    Paul Young
    (Knowledge is power! Get some!)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •