I also recommend a trigger that registers insertions somewhere in db (and you should still query the database, which is not so expensive if the trigger modifies a special table with one row). But if you have IDENTITY on your main key, you can control the value of the current table identifier:
SELECT IDENT_CURRENT('TableName')
This is a hack, however, but quick, and you do not need to modify your database (of course, it only works for insert operations). However, you can skip pasting operations if between the values โโof the survey identifier was explicitly changed and the value that it was at the time of the previous poll (which is not very likely) was set exactly.
Nicolai Shestakov
source share