Results 1 to 4 of 4

Thread: Trigger Problem

  1. #1
    Join Date
    Nov 2003
    Posts
    3

    Unanswered: Trigger Problem

    HI,

    I have two tables named as table1 and table2.

    In Table2 i have 2 columns one is sno and another one is email2
    In table2 i inserted the values through admin module.


    In table1 i have columns like id,name,address,email1,refno etc.
    When iam inserting the values in table1 programatically i need to check the values email1=email2. First time i have to insert the sno(in table2) as refno in table1. From second time onwards i have to insert the value as refno = max(refno) + 1...

    So Please help me how to write the trigger.

    Thanx and Regards
    Balu

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Triggers are very engine-specific. Which database engine (DB2, MS-SQL, Oracle, etc) are you using?

    -PatP

  3. #3
    Join Date
    Nov 2003
    Posts
    3
    Iam using MS-SQL

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Youll get a lot beter response on an MS-SQL question if you post it in the Microsoft SQL Server forum. In order to help people help you, you need to post the DDL for the tables (the CREATE TABLE statements), along with a few rows worth of examples of what data you'd like to process.

    -PatP

Posting Permissions

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