• The error I get states

    'Cannot insert explicit value for identity column in table 'TableName' when IDENTITY_INSERT is set to OFF.'

    the ERROR_ SEVERITY is 16

    when I run the query select * from sysmail_allitems I can see the email message in the bogy column, but the email does not go through, Database Mail has been configured already and is working since test emails do go through but I thing something is wrong with my code.

    Please let me know what you think

    or suggest a proven way how to have a sp in the catch block that sends an error email, I would like to use this sp all the time in catch blocks to send error emails.