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
JamesNTAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gustav BrockCIOCommented:
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.
Wayne BarronAuthor, Web DeveloperCommented:
Hey, James.
What are the errors you are getting?
JamesNTAuthor Commented:
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
SolarWinds® Network Configuration Manager (NCM)

SolarWinds Network Configuration Manager brings structure and peace of mind to configuration management. Bulk config deployment, automatic backups, change detection, vulnerability assessments, and config change templates reduce the time needed for repetitive tasks.

Gustav BrockCIOCommented:
It's not just like that.
But several guides can be found for the browsing. Too large a subject for a tiny question.
JamesNTAuthor Commented:
Ok, let me ask this:  Queries that are converted from Access to SQL Server then become pass-through queries in Access, correct?

James
Gustav BrockCIOCommented:
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.
JamesNTAuthor Commented:
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
Gustav BrockCIOCommented:
A PT query is certainly a candidate for an update query. And it is executed the same way.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JamesNTAuthor Commented:
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
Gustav BrockCIOCommented:
You are welcome!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SQL

From novice to tech pro — start learning today.