Friday, January 25, 2013

To integrate Salesforce with an External database

Scenario :-

To interact Salesforce with any external database like SQL server to get the real time data into the Salesforce for the Sql server database.

There is no facility to connect directly to your database with salesforce. However, using an integration service (or web-services, REST API, etc.), you can connect or sync to an external database.

Please refer to 2 below mentioned points :-

1. Integrate the data into and store the data using the Web Services API and then build your Visualforce page on that data as needed or you could use the Data Loader to update the data. More Info

2. Web-service enable your backend data and have apex make "callouts" (web service calls) to retrieve the data. There are some constraints about request and response size so please refer to below mentioned links for better understanding :-

2.1) If your web service provides a WSDL, you can try to import it to Apex and Apex will auto-generate the apex classes. More Info here


2.2) You can construct the web service message using the HTTP (RESTful) apex classes.More Info Here

Other APIs which can be referred to integrate Salesforce with other databases :-

  • Salesforce Web Services API 
  • Salesforce Bulk API 
  • Salesforce Rest API 
8 different APIs, click on it to find out which API should you use?

Following are the mentioned list of integration services:

1) Informatica Cloud
2) Cast Iron
3) SnapLogic
4) Boomi
5) JitterBit
6) Sesame Relational Junction

If anyone need the connection in one direction, Salesforce to Oracle, SQLServer, MySQL, or H2, you might try CopyStorm. It is from Capstorm and is listed on the AppExchange.

You can refer to below mentioned link to get this app from AppExchnage and contact the publisher for further details :-

CopyStorm Package


  1. Hi Ankit Rustagi, good post!

    I have some questions. If I would like to create a visual force page just to display data get from my local database (MSSQL) and upon clicking on a button will update back the data into my local database (MSSQL). I do not want to store any data in Salesforce. Will it be possible?


  2. hi ankit am not under standing how to connect with external system plz send the notes am getting idea through the pdfs but not getting connectivity let me know plz

  3. Hi Ankit,

    I want to integrate the salesforce with oracle database.So that If i add or update the data is oracle it should get automatically added/updated in salesforce.

    Is this possible?
    Currently we are using informatica in between but I don't want to use that.

  4. Hi Ankit, I need to integrate Salesforce to MySql (linux Server) and data needs to sent to SFDC to MySql what would be the best practice, how would be the connection to other direction?

  5. Thank you for giving us great info on integration of salesforce.

    Salesforce Integration Services

  6. The Blog gave me idea about the salesforce integration thanks for sharing this post and please continue to share this kind of post....
    salesforce integration

  7. I acknowledge the author for his brilliant work for making this exceptionally useful and informative content to guide us.
    Form Builder with Salesforce Integration

  8. This comment has been removed by the author.

  9. "Looking at the List of integration services, I`d like to add one more tool - Skyvia
    With help of it, you can integrate Salesforce with external database (SQL Server, MySQL, etc.) and keep it up-to-date automatically."