Discussion on:

Message 20 of 23
0 Votes
+ -
Not possible as far as I know
an update is effectively and insert and a delete so as far as the locking mechanisms go there isn't a distinction between updated and inserted.

These are only hints as well, the database engine will have a go, so you can't rely on it.

To get a similar effect, would be to have some field (or add an extra one) and have your inserts be
an insert with the field set to new record in one transaction, and then immediately follow it with an update set flagField = 0 where flagfield is 1 and ID = ...
sort of thing.

If you have a time created/inserted field on the table you might be be able to limit yourself to readpast where time_created GetDate()

Another possibility is to instead of having a flag field or date, have a table for 'new' records, then in a second transaction insert them into the 'real' table.

Another would be to have a date_modified field in the table, null on insert and any update transaction would set it to GetDate().

That woudl be readpast Where date_modified is not null.


Messy though, very messy, bound leap out and bite your arse at inconvenient times. silly

I'd be trying to design this necessity out as a matter of urgency.


Hths
Posted by Tony Hopkinson
Updated - 20th Sep 2010