• I noticed that the author uses this statement to grab the newly inserted identity:

    set @INSERTED_IDENTITY_ID = IDENT_CURRENT('HIST_ERROR_LOG');

    I think he meant to specify the table 'ERROR_LOG', not 'HIST_ERROR_LOG'.

    Also, IDENT_CURRENT will return the identity value of the table provided across all sessions, meaning you could get a value that some other thread generated. I usually rely on scope_identity(), which works all the time, except if you have a trigger on the table in which you're inserting into and that trigger happens to be inserting into yet another table with an identity (not a common scenario).

    Another confusing point of the article is the author's variable naming conventions, prefix of: '@$'. You only need to use @ to indicate something's a variable. I couldn't find any reference as to what the $ would stand for. My guess it's a remnant of an older style when variables were prefixed with $ (e.g. environment variables in a shell).