• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 452
  • Last Modified:

Vb.net Sql Store last value of a control field

I am using an application in multiposition environment (sqlserver/vb.net) and wanted to know what the last record inserted in a particular table and store the value of a control field, outside or in another bd bd. The intention is to know if someone deleted or changed the control id of the last record.
The reason I wanted to keep the last control field record  in an out bd is because someone can make a database restore.
1 Solution
Randy PooleCommented:
Not quite sure what your looking for, to pull back and identity value on an insert?
rflorencioAuthor Commented:

I have a table with a field called IdCtrl with an alphanumeric code assigned by application. Before insert a new record i need to know if this code is really the same of last record inserted.
In practice i need to ensure that the last record of the table is even the last. So if someone delete the last record I can know.
Is it your application only that inserts the records? If yes then you can store the IdCtrl in another database when you insert a record. That way, you have the last inserted id of the record in another database.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now