Microsoft – SQLServer – Error Handling – What to capture

Log4J, Log4Net are very good tools for centrally logging Exceptions in Java & MS .Net respectively.

Keeping this in mind, wondered what tools exist for centralizing Exceptions in Transact SQL.

Not aware of any.  But, that got me thinking of what things I will like to make note of:

Here is a short list:

  1. Server Name – Serverproperty(‘servername’)
  2. Database ID – db_id()
  3. Database Name – db_name()
  4. Procedure ID – @@PROCID
  5. Procedure Name – Object_name(@@PROC_ID)
  6. Error Procedure – Error_Procedure()
  7. Error Number – Error_Number()
  8. Error Message – Error_Message()
  9. Error Line – Error_Line()
  10. Error Severity – Error_Severity()
  11. Error State – Error_State()

 

 

 

 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s