Thanks for using MS Q&A platform and posting your query.
To identify the database name from the Synapse serverless SQL pool query history, you can use the following methods:
- Dynamic Management Views (DMVs): While DMVs provide extensive details about query execution, they might not directly show the database name. However, you can use the
sys.dm_exec_requests
andsys.dm_exec_query_stats
DMVs to gather more context about the queries. - Query Store: If enabled, the Query Store can provide insights into query performance and history. You can enable it using the following command:
This will help you track queries and their associated databases.ALTER DATABASE <database_name> SET QUERY_STORE = ON;
- Azure Log Analytics: By integrating Synapse with Azure Log Analytics, you can query the
SynapseBuiltinSqlPoolRequestsEnded
table to get detailed logs, including the database context. - Synapse Studio Monitor Hub: The Monitor Hub in Synapse Studio provides a visual interface to monitor SQL requests. You can customize the columns to include more details about the queries, which might help in identifying the database.
I hope these steps help you resolve the issue. Please Let me know if issue persists.