Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2004
    Posts
    1

    Question Unanswered: Duplicate Rows Blues

    Hello,
    I would like to prevent Contacts being inserted into the database when inserted Contact:

    firstname + ', ' + lastname + ', ' + workphone

    is identical with existing Contacts:

    firstname + ', ' + lastname + ', ' + workphone

    Can this be done with an Insert Trigger and if so, how? Thank you in advance,
    Lars

  2. #2
    Join Date
    Aug 2004
    Posts
    330
    You could add an alternate key to the entity on those attributes. In your physical implementation, add a "UNIQUE" constraint and a unique index on those columns. It could be done with a trigger, but it will probably not preform as well.

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I'll second that recommendation. A UNIQUE constraint should be more efficient (and simpler) than any trigger you could write.

    -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
  •