databricks-dbsql

Extend Databricks SQL with procedural scripts, stored procedures, and recursive queries.

31|18|Updated Apr 4, 2026
One-click install
npx skills add https://github.com/ThomazRossito/data-agents --skill databricks-dbsql-thomazrossito
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: databricks-dbsql
Source: https://github.com/ThomazRossito/data-agents/tree/main/skills/databricks/databricks-dbsql
Command: npx skills add https://github.com/ThomazRossito/data-agents --skill databricks-dbsql-thomazrossito

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

DBSQL extends standard SQL with procedural constructs (BEGIN...END blocks, DECLARE, loops, conditionals, EXECUTE IMMEDIATE) and transactional controls to build reliable ETL, orchestration, and governance logic inside Databricks without relying on external scripting.

Core Features & Use Cases

  • Procedural SQL: BEGIN...END blocks, variable declaration, control flow, exception handling
  • Stored Procedures: CREATE PROCEDURE and CALL for encapsulated logic
  • Recursive CTEs: WITH RECURSIVE for hierarchies and graph traversals
  • Transactions and atomic blocks: BEGIN ATOMIC blocks for multi-statement reliability
  • Dynamic SQL: EXECUTE IMMEDIATE for runtime SQL generation
  • Use cases: ETL pipelines, data quality checks, workflow orchestration, hierarchical data processing

Quick Start

Invoke a sample stored procedure to summarize today's orders and return a status.

Frequently Asked Questions about databricks-dbsql

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write stored procedures in Databricks SQL?

You can write stored procedures in Databricks SQL using procedural constructs like CREATE PROCEDURE, CALL, and BEGIN...END blocks to encapsulate complex logic. This enables reliable ETL orchestration and data quality checks directly within the DBSQL environment.

What is procedural SQL scripting in Databricks used for?

Procedural SQL scripting in Databricks extends standard SQL with variables, loops, and conditionals to build reliable ETL pipelines and governance logic. It eliminates the need for external scripting by handling complex data workflows and exception management natively.

Can I run hierarchical data processing with recursive CTEs in Databricks?

Yes, you can process hierarchical data and perform graph traversals in Databricks using the WITH RECURSIVE clause. This procedural SQL feature allows you to query multi-level hierarchies directly inside the DBSQL environment without external orchestration tools.

Do I need Unity Catalog and serverless SQL warehouses to use procedural SQL in Databricks?

Yes, accessing procedural features like EXECUTE IMMEDIATE, MERGE, and WITH RECURSIVE requires Databricks Runtime 17.x or higher. You must also enable Unity Catalog and use serverless SQL warehouses to execute these transactional workflows and automated governance scripts.

How do I execute dynamic SQL statements at runtime in Databricks?

You can execute dynamic SQL at runtime in Databricks using the EXECUTE IMMEDIATE statement. This feature generates and runs SQL scripts on the fly, allowing flexible workflow orchestration and automated governance across Delta tables inside BEGIN ATOMIC blocks.

Why should I use procedural SQL instead of external scripting for ETL pipelines in Databricks?

Using procedural SQL instead of external scripting simplifies complex data workflows by keeping transactional controls and exception handling directly inside Databricks. This approach leverages BEGIN ATOMIC blocks for multi-statement reliability and reduces orchestration overhead across Delta tables.