function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Micky MMicky M 

SQL Database

Hi All,


Does anyone know a way to connect salesforce to different databases? MS SQL etc? We have a number of databases that we need to pull together in salesforce. It need to be automatic so a way to use apex would be idea. Any ideas?



Micky MMicky M

Hi yes ive used ant before, but this isnt a one off operation. I need to do this possibley every day or whenever the data changesl. Thats why i was wondering if i could schedule a job to say select all the relavent data from an sql data base and populate my salesforce objects.


To your point 

>> i could schedule a job to say select all the relavent data from an sql data base and populate my salesforce objects

You can't use Apex to query SQL data base.  So probably you need to build a third party program(s) that queries the SQL and hand it over to Salesforce using SF's Entriprise WSDL. 


And it is possible to schedule those third party programs to identify the data changes and hand over the right data to SF.


To summarize:

1. You will need a third party program ( Built on C#.Net/Java etc) that Queries the correct data sets based on your criterion.

2. You need to integrate your SF Org's Enterprise WSDL into the Third party program so you can hand over the data sets to the SF.

3. Your third party program (As an .exe file) can be scheduled as a task from Control Panel(In Windows Operating System. I am not sure about Mac).


BTW, I had done a task of developng C#.Net program that regularly Queries SF through Enterprise WSDL and post that data as an Excel sheet to SF Chatter :) Your requirement reminded me of that task. All the best. I am hoping you will achieve this.

Cory CowgillCory Cowgill

There are many options for you to accomplish this.


I prefer Talend Open Studio for Data Integration (Free, Open Source) - It has SFDC Connectors built in (They use SFDC SOAP API), Build ETL Jobs, export as runnable jars, schedule to run every day. Take a look at this: This will show you how to do exactly what you are asking. To automate you would click File -> Export -> Runnalbe JAR. Then use Windows or Mac services to schedule the Jar to execute daily.


Informatica Cloud, Dell Boomi, DBAmp, and many other ETL tools will provide this functionality also. They will cost money (but provide support), but are also perfectly acceptable solutions.


Thanks for posting the  video link. I there any possiblity of data loss due to the data type mismatch during the ETL process we need to keep in mind.

Cory CowgillCory Cowgill

You will need to make sure to match up the Data Types during the ETL process. That is agnostic to SFDC though, you would need to do that for any ETL process.


That video I posted is a quick start. For a full blown ETL job you will do more detailed mapping.


Also you can insert/update data into SFDC. That video just shows the extraction, but you can use components to push data into SFDC.


In general take a look at the Integration section of Developer Force. There are lots of great articles, examples, and tutorials on there to provide you the information you need.