How to connect Salesforce to SQL Server with SSIS



Using SQL Server as a backup for critical business data provides an essential safety net against loss. In addition, backing up data to SQL Server enables business users to more easily connect that data with features like reporting, full-text search, analytics, and more.

This example demonstrates how to use the CData ADO.NET Data Provider for Salesforce inside of a SQL Server SSIS workflow to transfer data directly from Salesforce into a Microsoft SQL Server database. The exact same procedure outlined below can be used with any CData ADO.NET Data Providers to connect SQL Server directly with remote data via SSIS.

  1. Open Visual Studio and create a new Integration Services Project.
  2. Add a new Data Flow Task from the Toolbox onto the Control Flow screen.
  3. In the Data Flow screen, add a ADO.NET Source and an OLE DB Destination from the Toolbox.
  4. Add a new Data Connection, and select the CData Provider for Salesforce.
  5. Enter the connection details for your Salesforce account. In this example, we are using a Salesforce Developer Account for this example. Required connection properties are User, Password, and Access Token. OAuth is also supported. See the "Getting Started" chapter for a guide to connecting from SSIS.
  6. Open the ADO.NET Source editor and set the following information:
    • ADO.NET connection manager: In the Connection Managers menu, select the Data Connection you just created.
    • Data access mode: Select 'SQL command'.
    • SQL command text: In the ADO.NET Source editor, open the Component Properties tab and enter a SELECT command, such as the one below:
      SELECT * FROM Account
  7. Close the ADO.NET Source editor and drag the arrow below the ADO.NET Source to connect it to the OLE DB Destination.
  8. Open the OLE DB Destination and enter the following information in the Destination Component Editor.
    • Connection manager: Add a new connection. Enter your server and database information here. In this example, SQLExpress is running on a separate machine.
    • Data access mode: Set your data access mode to "table or view" and select the table or view to populate in your database.
  9. Configure any properties you wish to on the Mappings screen.
  10. Close the OLE DB Destination Editor and run the project. After the SSIS Task has finished executing, your database will be populated with data obtained from Salesforce.

SSIS Sample Project

To get started using the CData ADO.NET Provider for Salesforce within SQL Server SSIS, download the fully functional sample project.

Note: Before running the demo, you will need to change your connection details to fit your environment.