 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Tumurbaatar S. Guest
|
Posted: Mon Mar 21, 2005 4:08 am Post subject: Detecting missing records |
|
|
A SQL2K db has a table which contains a datetime field. Some app
adds a new record every N minutes and a current time is saved in above
datetime field. To detect whether the app failed or something occurred
that a record was not added, I'm planning to use below query:
SELECT * FROM tbl o WHERE NOT EXISTS (SELECT * FROM tbl i
WHERE i.dt_field = DATEADD(minute, N, o.dt_field))
It seems that works well and if there's no missing record, the query
returns the last inserted record only.
But there's one problem. The above query uses SQL2K function DATEADD(),
but I need something universal which works on every ADO/OLEDB compliant
RDBMS. Any ideas?
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|