I'm logging many things via Extended Events. I saw the error_reported
or errorlog_written
is very generic and logs a lot of errors.
With Extended Events, is it possible to get an SQL transaction or statement error?
I'd like to get the log using Extended Events if a SQL of INSERT, SELECT, UPDATE, DELETE or other returns an error.
Is it possible?
I think this is a good article:
https://dbafromthecold.com/2017/06/07/identifying-failed-queries-with-extended-events/
I think the answer is to use error_reported with severity = 15 with says: Indicates syntax errors in the Transact-SQL command.