Expert guide
AI-Assisted Access to SQL Server Migration
SSMA moves the tables. AI speeds up the queries, code and testing that decide whether it works.
Call us at +1 (385) 386-3860
Short answer: use SQL Server Migration Assistant for Access to move tables, keys and data, then use AI to translate Access queries into T-SQL views, scan VBA for patterns that break on linked SQL tables (dbSeeChanges, AutoNumber timing, Seek, date and wildcard syntax), and draft test cases. AI shortens the slowest phase, fixing and testing, but every translated query still needs verification against real results. For a fixed-scope migration, see Access to SQL Server migration.
Most Access to SQL Server migrations follow the same arc. Tables move in an afternoon. Then the forms get slower instead of faster, a few buttons throw errors, a monthly report returns different totals, and the project drags on for weeks. The tables were never the hard part; the hundreds of queries and VBA procedures written for Access's engine are.
AI is genuinely good at that hard part: reading Access SQL and VBA, explaining it, translating it and spotting known problem patterns. Used well, it compresses weeks of tedious review into days. Used carelessly, it introduces subtle differences in results.
Where AI Helps, Phase by Phase
| Phase | Main tool | How AI helps |
|---|---|---|
| Discovery and documentation | Export of queries, forms, modules | Explains each object, lists dependencies, flags risks |
| Schema migration | SSMA for Access | Reviews data type mappings and suggests indexes |
| Query conversion | Views, stored procedures, pass-through queries | Translates Access SQL to T-SQL |
| VBA remediation | Manual code changes | Scans for breaking patterns and proposes fixes |
| Testing | Side-by-side result comparison | Drafts test cases and comparison queries |
| Cutover | Runbook and relinking | Drafts the runbook checklist |
Phase 1: Document Before You Move Anything
Export every query's SQL and every module as text, then use AI to classify them: still used or dead, read or write, heavy or light. The full routine is in documenting a legacy Access database with AI. Retiring dead objects before migration is the cheapest performance win available.
Phase 2: Move Tables With SSMA, Review With AI
Run SSMA for Access to create the SQL Server schema and migrate data.
Export the SSMA assessment report and the generated table definitions.
Ask AI to review the mappings: Currency to money or decimal, Date/Time to datetime2, Yes/No to bit with a default, Long Text to nvarchar(max).
Ask it to propose indexes on every foreign key and on fields used in WHERE clauses of your heaviest queries.
Add a rowversion column to tables edited through forms; Access uses it to detect changes efficiently.
Phase 3: Translate Heavy Queries to T-SQL
Not every query needs translating. Simple selects on linked tables run fine. Translate the ones that are slow or use Access-only functions.
Prompt:
Translate this Microsoft Access query to a SQL Server T-SQL view.
- IIf → CASE, Nz → ISNULL/COALESCE, & → + or CONCAT, # dates → 'yyyy-mm-dd'
- DLookup/DSum → joins or correlated subqueries
- Format() for grouping → FORMAT or CONVERT, prefer date arithmetic
- Keep column names identical so forms and reports still bind.
- List anything whose behaviour may differ (nulls, rounding, collation).
Access SQL:
SELECT c.CustomerID, c.CompanyName,
Nz(DSum("Amount","tblInvoices","CustomerID=" & c.CustomerID & _
" AND Paid=False"),0) AS OpenBalance,
IIf(OpenBalance>10000,"Review","OK") AS Flag
FROM tblCustomers AS c;Expected T-SQL view:
CREATE VIEW dbo.vwCustomerOpenBalance AS
SELECT c.CustomerID, c.CompanyName,
ISNULL(i.OpenBalance, 0) AS OpenBalance,
CASE WHEN ISNULL(i.OpenBalance, 0) > 10000 THEN 'Review' ELSE 'OK' END AS Flag
FROM dbo.tblCustomers AS c
LEFT JOIN (SELECT CustomerID, SUM(Amount) AS OpenBalance
FROM dbo.tblInvoices WHERE Paid = 0
GROUP BY CustomerID) AS i
ON i.CustomerID = c.CustomerID;Link the view in Access with the old query's name, or point the form's record source at it, and the form now gets one pre-aggregated result from the server instead of running a DSum per row.
Phase 4: Scan VBA for Breaking Patterns
| Pattern | Why it breaks | Fix |
|---|---|---|
| OpenRecordset without dbSeeChanges | Error 3622 on tables with identity columns | Add dbOpenDynaset, dbSeeChanges |
| Reading !ID right after AddNew | Identity value assigned only after Update | Read it after .Update with .Bookmark = .LastModified |
| .Seek or dbOpenTable | Not supported on linked tables | Use FindFirst or a filtered recordset |
| SQL strings with # dates or * wildcards in pass-through | T-SQL syntax differs | Use 'yyyy-mm-dd' and % |
| Yes/No compared to -1 (True) | bit is 1 on SQL Server | Compare to True or <> 0 |
| Long transactions holding locks | Blocks other users on the server | Shorter transactions, set-based updates |
Prompt: Here is an Access VBA module. The tables will become linked SQL Server tables with identity primary keys and bit fields for Yes/No. List every line likely to break or slow down, why, and the corrected code. Do not change behaviour beyond what the migration requires.
Phase 5: Test by Comparing Results
Keep a copy of the pre-migration Access database as the reference.
For each important query and report, run it on both, export to Excel, and compare row counts and totals.
Ask AI to draft a test list from your documentation: every form action that writes data, every report used monthly.
Test with several users at once; concurrency problems do not show up in single-user testing.
Time the slowest forms before and after; performance is often the reason for migrating.
Where AI Is Not Enough
Deciding what to migrate, what to retire and what to rebuild.
Security design: logins, roles and which users can see which tables.
Backup, maintenance plans and hosting decisions.
Judging when a translated query is 'equivalent enough', especially with nulls, rounding and text collation.
Cutover planning when people use the database every day.
Before migrating, check whether you actually need to: the Access 2 GB limit and ODBC call failed errors guides cover common triggers. If SQL Server is the right move, our migration service uses these AI-assisted steps inside a fixed-scope plan, with testing and cutover included.
FAQ
AI and Access to SQL Server migration FAQ
Queries, code, testing and timelines