Unanswered: "inserted" and "deleted" tables - order of rows
I have a question about the "inserted" and "deleted" tables which I am using in my triggers on an Adaptive Server Enterprise/15.0/.
Let's say I have an UPDATE trigger trg1 on table tbl1. When I update 5 rows from tbl1, the tables "inserted" and "deleted" will both have 5 entries which I can use in my trigger trg1.
In table "inserted" will be the "new" data - in "deleted" the "old".
Now my question: Can I feel certain, that row 1 from table "inserted" is the new data and in row 1 from table "deleted" I can find its old?
I want to be sure that row 1 from "inserted" belongs to row 1 from "deleted", and row 2 from "inserted" belongs to row 2 from "deleted" and so on..
I've done some testing and it seems that they do, but maybe it was just coincidence or my test was too simple.
The problem is that I can't order by any specific column or columns.
I would need a column (or columns) that will not change.
Normally that would be the primary key.
But the primary key of my table, on with the trigger reacts, consists of several rows and each row could be updated.
So if I order by them the "deleted" and "inserted" table will definite be different in some cases.
I tried to work with ROWID but it seems that ROWID doesn't exists for ASE 15 but only for IQ.