- 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.
Does not connect to any database, run SQL, edit your files, or convert SSIS packages (SSIS/SSRS out of scope; it only lists embedded SQL). The scanner is regex-based and can give false positives (e.g. + in arithmetic flagged as concatenation); the agent confirms each finding in context.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
1 use
Times used to date
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 1 month ago
- Free with an Agensi account
Requires
Permissions
Read: your .sql files Bash: `python scripts/scan_tsql.py` (Python 3 standard library, read-only, no network, no file writes) No credentials, database connections or write access