Error handling and logging in Azure Synapse data warehouse.

Yamel Peraza 20 Reputation points
2023-05-06T00:07:55.3766667+00:00

Hello everyone, I was wondering if implementing try-catch logic in user-defined stored procedures is considered a good idea or best practice for handling errors in Synapse DW. Additionally, I would like to know if it is advisable to create table(s) and custom stored procedure(s) for logging purposes within Azure Synapse Data Warehouse during ETL. To provide some context: in SQL Server, ETL developers typically wrap stored procedures with try-catch blocks and use custom stored procedures or logging frameworks to log execution and errors. I am asking this question because I am new to Azure Synapse DW and have been tasked with creating stored procedures. However, the existing ones in the organization lack error handling and logging, and I haven't been able to find examples or discussions about this topic online. Is the approach of using try-catch and logging considered best practice in Azure Synapse DW? Thank you in advance.

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,406 questions
0 comments No comments
{count} votes

Accepted answer
  1. Suba Balaji 11,186 Reputation points
    2023-05-08T11:35:39.3566667+00:00

    Hi @Yamel Peraza

    Implementing try catch is the recommended way to capture exception with SQL Server/Synapse analytics/az SQL database Since the try catch construct is the same for all these technologies, you might not see references related to exactly synapse procedures. But all the implemention is similar to that of SQL server. So you may go ahead ahead and implement exception handling/ logging as you have planned. Please let us know for anything else you would like to know.

    Thanks.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful