How to get the last created or modified dataset

  • Thread starter Thread starter thalion77
  • Start date Start date
T

thalion77

Hello,

is there a possibility to get the ID of the last created or modified
dataset of a table via ADO.NET? Is there a database independent way?

In SQL Server you can call the scope_identity() function, but this
won't work in Oracle, MySQL, Access a.s.o.

Thanks in advance,
Norbert
 
Norbert,

If you are trying to retrieve the database-generated primary key value for a
newly inserted row, there is no database-independent way to do that, as far
as I know.

In SQL Server you can select scope_identity, in Access you can select
@@identity, in Oracle you need to query the appropriate sequence object, etc.

Kerry Moorman
 
Back
Top