When you are analyzing deadlocks you want to know what database it is. However the database name is not always available in the extended event xml_deadlock_report.
Let's look at what we have:
process-list - Here you have the [currentdb] that is the database_id.
The database_id is useful but sometimes you don't have access to the server. It could also be that the database no longer exists or that the database_id has changed. So it would be great if the database name could be added here.
executionStack - For a stored procedure you have the database name in the [procname]. However for ad-hoc queries it only says procname="adhoc". It would be nice with a database_name attribute here.
resource-list - Here you have the database name in the [objectname] in most cases. However for some deadlocks there is no object_name.
The database_name action for the xml_deadlock_report event always returns the master database.
I am looking for a reliable way to always get a database name in a deadlock graph.