Results 1 to 2 of 2
  1. #1
    Join Date
    May 2003
    Posts
    23

    Unanswered: Update Trigger and record to record comparision...

    Hi guys,
    I am trying to implement an Update Trigger for my program...I needed to copmare whether two instances of the same table( for examples inserted and deleted pseudo Tables and assume that after running a query these tables have only one record in each of them) has same record or not. Is there any inbuilt mechanism in SQL for record to record comparison ( Instead of field to field comparision in each record??).

    Thanks,
    Sai

  2. #2
    Join Date
    Apr 2003
    Location
    Israel
    Posts
    81
    Try:

    select count(*) from
    (select * from inserted
    union
    select * from deleted)

    Since UNION eliminated duplicate rows, you'll get count(*)=1 if the rows are identical and 2 if not.
    --
    kukuk

Posting Permissions

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