MetricSign
EN|NLRequest Access
Medium severitysql

Power BI Refresh Error:
USER_RAISED_EXCEPTION

What does this error mean?

A RAISE or SIGNAL statement in a Databricks SQL script or stored procedure explicitly raised an exception. This is an intentional, code-defined failure used to enforce business rules or data quality constraints.

Common causes

  • 1A data quality check in a SQL script used RAISE to abort processing when invalid data is detected
  • 2A stored procedure enforces a business rule (e.g., no negative balances) and raises an exception when violated
  • 3An orchestration script raises an exception to signal upstream failure before proceeding
  • 4A dbt test or data contract assertion translated to SQL RAISE logic
  • 5A migration script raises an exception if preconditions are not met

How to fix it

  1. 1Read the exception message — it will contain the developer-defined description of why the exception was raised
  2. 2Investigate the upstream data condition that triggered the exception
  3. 3Resolve the data issue that violated the business rule or quality check
  4. 4If the exception is raised too aggressively, adjust the threshold or logic in the RAISE statement
  5. 5Consider whether the exception should block the job or be logged and skipped for certain row sets

Frequently asked questions

Is USER_RAISED_EXCEPTION always a problem?

No — it is intentional. It means a developer wrote logic to stop the job when certain conditions are met. The real question is whether the condition that triggered it is expected or a sign of data degradation.

How do I raise a custom exception in Databricks SQL?

Use: RAISE (MESSAGE => 'your message', SQLSTATE => 'P0001'). This gives you control over the error message that appears in the job failure details.

Other sql errors