0

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?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
felipe
  • 1,212
  • 1
  • 15
  • 27

1 Answers1

0

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.

https://learn.microsoft.com/en-us/sql/relational-databases/errors-events/database-engine-error-severities?view=sql-server-2017

felipe
  • 1,212
  • 1
  • 15
  • 27