Thursday, March 8, 2012

Access to SQL migration

I am trying to migrate a set of MS Access queries to SQL that call Access VB
A
code. For example, this is typical:
SELECT Name, DOB, VeryComplexFunction([Value]) AS NumericResult
FROM Table
where,
VeryComplexFunction is a function that is in an Access VBA code
module
All the Access query/VBA works of course, but now I need to migrate to SQL.
I be very grateful for for any help or pointers that anyone can offer.
Thanks in advance."A Shasore" <AShasore@.discussions.microsoft.com> wrote in message
news:8B40B5D3-D11F-437D-B1BA-BEBA142D4C4F@.microsoft.com...
> I am trying to migrate a set of MS Access queries to SQL that call Access
VBA
> code. For example, this is typical:
> SELECT Name, DOB, VeryComplexFunction([Value]) AS NumericResult
> FROM Table
> where,
> VeryComplexFunction is a function that is in an Access VBA code
> module
> All the Access query/VBA works of course, but now I need to migrate to
SQL.
> I be very grateful for for any help or pointers that anyone can offer.
> Thanks in advance.
>
I had a similar problem when I was tasked to upgrade my companys system from
Access to MSSQLS.
What you're looking at is recreating the VBA function as an SQL Server User
Defined Function (UDF) - which is going to require a knowledge of T-SQL.
For upgrading in general I can heartily recomend "Microsoft Access
Developer's Guide to SQL Server" by Chipman & Baron (0-672-31944-6).
Sorry this is a bit vague but I hope it helps.
Thanks
Chris.|||An in-line expression and then a user-defined function should be the
first things to try. Other options are to use an Extended SP or do the
calc in your middle tier.
Don't assume that the way it is done in VB is the best way in SQL. For
example, calculations involving many inputs could possibly be
simplified with a more set-based approach using joins and aggregates.
David Portas
SQL Server MVP
--

No comments:

Post a Comment