- Home
- Skills
- Data & Databases
- T-SQL to Databricks Migration Auditor
T-SQL to Databricks Migration Auditor
Scan SQL Server T-SQL for what breaks on Databricks, get risk-ranked fixes, MERGE rewrites and reconciliation queries.
Free
Works with the AI Agents you already use
T-SQL to Databricks Migration Auditor
Example session with this skill installed
Audit sql/usp_LoadDailyOrders.sql for our Databricks migration and propose the Databricks version.
- Read your context and instructions
- Compiled the t-sql to databricks
(This is the scanner's real output on the bundled example examples/sample_proc.sql, plus the skill's rewrite. The full table is shortened here.)
# T-SQL -> Databricks scan
Files scanned: 1 | findings: 24 (high 9, medium 6, low 9)
| high | :1 | Stored procedure | Unity Catalog SQL procedure or notebook/job task |
| high | :5 | TRY/CATCH | SQL scripting handler or PySpark try/except |
| high | :6 | Explicit transaction | single MERGE or stage + swap |
| high | :9 | CONVERT with style 120 | date_format(d,'yyyy-MM-dd') |
| high | :11 | #temp table | CREATE OR REPLACE TEMP VIEW / CTE |
| medium | :16 | UPDATE ... FROM join | MERGE INTO |
| low | :12 | NOLOCK hint | remove |
Effort: 1 object, bucket = redesign (procedure + transaction + temp table).
Proposed Databricks SQL
CREATE OR REPLACE TEMP VIEW recent AS
SELECT o.OrderID,
COALESCE(c.`Customer Name`, 'Unknown') AS CustomerName,
date_format(o.OrderDate, 'yyyy-MM-dd') AS OrderDay,
concat(c.FirstName, ' ', c.LastName) AS FullName, -- VERIFY: NULL names give NULL, same as T-SQL '+'
o.Amount
FROM main.sales.orders o
JOIN main.sales.customers c ON c.CustomerID = o.CustomerID -- VERIFY: case-sensitive compare if keys are strings
WHERE o.OrderDate >= dateadd(DAY, -1, :run_date);
-- VERIFY: the original TOP 1000 had no ORDER BY, so it was non-deterministic. It's dropped here; confirm the intent.
MERGE INTO main.sales.fact_orders t
USING recent r ON r.OrderID = t.OrderID
WHEN MATCHED THEN UPDATE SET t.Amount = r.Amount;
-- A single MERGE is atomic on Delta, so the BEGIN TRAN/COMMIT wrapper isn't needed.
Then come row-count, sum(Amount) and hash-diff queries for fact_orders on both sides. (main.sales is a placeholder; the skill asks for your catalog mapping.)
Connects securely to your tools. The creator never sees your data.
About this skill
Migrating SQL Server to Databricks? Most of the pain isn't syntax. It's the code that still runs after conversion but returns different numbers: DATEDIFF boundary counting, case-sensitive joins, CONVERT style codes, time zones, and multi-statement transactions that Delta won't treat as one unit.
This skill gives your agent a repeatable migration-audit workflow:
- Scans
.sqlfiles and folders with a bundled, read-only Python scanner (stdlib only, no installs). It covers 41 T-SQL patterns and reports file:line evidence and severity. - Triages each object as mechanical, review, or redesign, so you can scope the work honestly.
- Rewrites high-risk objects set-based: cursors and WHILE loops become window functions, UPDATE…FROM becomes MERGE INTO, #temp tables become temp views, and dbo maps to Unity Catalog. Every behaviour change is marked with
-- VERIFY:. - Reconciles with matching source and target queries for row counts, key uniqueness, null and sum profiles, and SHA-256 row hashes.
Built by a data engineer who has done SQL Server → Databricks Delta migrations in production.
What it won't do: connect to any database, run SQL, edit your files, or convert SSIS packages.
How to use
Skills on Agensi run inside your AI agent. Copy the prompt, paste it into your agent, and it connects to Agensi and installs this skill for you. If a payment is needed, your agent shows it to you first.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scanned
Verified clean 5 days ago
- Free to download with an account
Requires