Link to home
Create AccountLog in
Avatar of JamesNT
JamesNT

asked on

Converting Access Application to SQL Server

I'm using the SQL Server Migration Assistant for Access to move an Access database to SQL Server.  Many of the queries failed to migrate.  Here is an example of one:

UPDATE ttbl_Equian_Clients, qryEquian SET qryEquian.Parent = IIf([AccountName]="Equian",[ClientName],[AccountName]), qryEquian.[Employer/Insured] = [ClientName], qryEquian.payor = IIf([AccountName]="Equian",[ClientName],[AccountName]), qryEquian.[claim admin] = IIf([AccountName]="Equian",[ClientName],[AccountName])
WHERE (((ttbl_Equian_Clients.[Client ID])=Left([CLAIM NUMBER],4) Or (ttbl_Equian_Clients.[Client ID])=Left([CLAIM NUMBER],5)));

Open in new window


How do I fix such a query and manually migrate it?  I can easily turn that into a stored procedure, but how does Access then know to use the stored procedure?

Apologies if I seem a bit dumb, this project kinda got thrown at me and I'm a SQL Server guy, not an Access guy.

James
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

SSMA is for migrating tables and schemas, and will also convert simple queries.
The "difficult" queries, however, it is not good at. Those you will have to handle manually.
Hey, James.
What are the errors you are getting?
Avatar of JamesNT
JamesNT

ASKER

I'm getting three basic errors depending on which query failed:

A2SS0061: The identifier 'IIf(BOOLEAN, UNKNOWN, NUMERIC)' was not converted.  --- I assume here I'll need to manually make a new query using SELECT CASE WHEN END.

A2SS0069: External variable cannot be converted.  ---  The query is referencing field on a form.  I'll have to have the form save data to SQL Server first - maybe to a temp table.

A2SS0061: The identifier 'Month(UNKNOWN)' was not converted.  --- Convert to SQL Server date time commands.

So I can create views, stored procedures, and so on all day in SQL.  How do I get Access to use them instead of the queries it has?  Is there a link command or something?

James
It's not just like that.
But several guides can be found for the browsing. Too large a subject for a tiny question.
Avatar of JamesNT

ASKER

Ok, let me ask this:  Queries that are converted from Access to SQL Server then become pass-through queries in Access, correct?

James
No, they could be views that are linked. Also, PT queries are read-only which, in many cases, is useless.

But there is no right or wrong method, it all depends. An application may run fine with no converted queries at all - leaving the job to the ODBC driver. Most start there, then localise bottlenecks, if any, and then work with these.
Avatar of JamesNT

ASKER

Gustav,
Ok, we are getting somewhere.  The vast majority of queries in the Access database are SELECT so they can all become views.  I'm totally fine with that.  The handful of Update queries I was going to make into Stored Procedures in SQL Server.  How would I reference those in Access if Pass-through is not an option for them?

James
ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of JamesNT

ASKER

Very good.  Thank you for the assist.

With over 400 queries and right at 300 of the failing the migration assistant, I do have some work ahead of me.  But most of it is changing DATE() to GETDATE() and IIF() to SELECT CASE.  I just needed to know how Access references the new objects once moved to SQL Server.

James
You are welcome!