I will be running insert queries on several tables, each of which will include the insertion of thousands of records. For various reasons, the server hiccups now and then and the query fails. When it does, I need to know the last record successfully inserted. The query will, generically speaking, look like this:
select emp, date, hours from table 456
if the query errors on emp 'JoeBlow', I want the error message to list JoeBlow as the record that generated the error.