Results 1 to 2 of 2
  1. #1
    Join Date
    May 2017

    Unanswered: Trigger Statement

    So I need to create a trigger that creates a new evidence number for each case. For instance, case #1 can have evidence #'s 1,2,3,4 and so on. Case #2 can also have evidence #'s 1,2,3, etc.

    So I have a "Case" table (CaseID as PK) and a "Evidence" Table (EvidenceNum as PK and CaseID as FK and associated attributes)

    So everytime I search for a specific caseID (case IDs are static and never change), I want a new "EvidenceID" column to populate. Such as Evidence item #1, #2, and so on. So these numbers can be repeated for each case. Hence why this is not the primary key. EvidenceNum is primary key but that wont be seen by the end user. Any help with this??

  2. #2
    Join Date
    Oct 2007
    Provided Answers: 9
    triggers are based on an action occurring(Insert,Update,Delete). Doesn't sound like you have one of those occurring. You may have to just put an insert into your process, that when a search is done, you insert to your evidence table. Though, sounds like your table may be misnamed, sounds more like an audit table.

Tags for this Thread

Posting Permissions

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