Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 vba to sql

Author  Topic 

nice123ej
Starting Member

48 Posts

Posted - 2010-02-21 : 00:33:15
Hi
is there any tool / function that will convert vba code to sql ?

example i want to convert this vba
if(a + b > 100, a, b)
to sql like this
CASE WHEN a + b > 100 THEN a ELSE b END

is there is anything like that to do the conversion programatically?
Thanks

Kristen
Test

22859 Posts

Posted - 2010-02-21 : 03:58:57
I think it is unlikely because the VBA will be procedural (loops and individual manipulation statements) whereas the SQL will be set-based (processing all rows in a given set in one single statement).

I think any conversion would probably use Cursors (in order to mimic the way that VBA would process the data) which would be very inefficient in SQL.

If you describe the problem you are facing in more detail someone might have a suggestions to make
Go to Top of Page
   

- Advertisement -