Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2008
    Posts
    4

    Unanswered: How to make a basice trigger?

    Dear All,

    Im verry new in this and hope you guys help me.
    i have two tables:
    - articles
    - customers

    the pk of the table customers is the fk in the table articles.

    i want to write a trigger: when inserting a new record to the table 'customers', a new record most be added into the 'articles' too. the new record in the 'articles' most have the new added 'customernr' and in the second column(this table has two columns) a '0' .

    Thanks

  2. #2
    Join Date
    Jul 2006
    Posts
    22
    May be you want something like this:

    Code:
    create trigger "ins_cust" on customers for insert
    as
    begin
        insert into articles select pk_column,0 from inserted
    end

Posting Permissions

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