views:

904

answers:

2

Has any one done SQL to SOQL Conversion for Salesforce.com Objects?

+2  A: 

No.

If you want a more meaningful answer than that (or "yes") then you may want to expand on your question a bit. Are you having a specific issue? Are you looking for opinions on tools to use?

Tom H.
+4  A: 

Yes.

ForceAmp makes a product called dbAmp, which lets you add Salesforce as a linked server in MS SQL.

This lets you perform queries directly against Salesforce.com data inside a SQL Server database, with syntax such as:

SELECT a.Id, a.Name, c.Name 
FROM Salesforce...Account a
LEFT JOIN Salesforce...Contact c ON (a.ID = c.ID)
WHERE a.Name LIKE '%, Inc.'

Which, in essence is the same as the SOQL

SELECT Id, Name, (SELECT Name From Contacts) FROM Account WHERE Name LIKE '%, Inc'

That said, the best use case of dbAmp isn't to replace your SOQL with SQL, but to use TSQL to do some advanced manipulation with your Salesforce.com data. Don't use it as a crutch to avoid learning SOQL -- SOQL is very expressive and robust, and several orders of magnitude faster when doing multiple-object queries, even in the trivial example I posted above (3 seconds vs 3 minutes, and counting...)

Jeremy Frey