Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Need to Update salesforce system with external SQL server database on daily basis

Posted on 2009-02-03
Medium Priority
Last Modified: 2013-11-24
Hi All,
I need to find out a solution to update salesforce system with external SQL server database on dialy basis. I want this to be implement from salesforce system rather than from SQL server system.
we need to update contact records.

Could any help me out how can i do this using some sort of Apex coding.

Thanks in advance.
Question by:SivaKumarArepogu
  • 3
  • 2

Author Comment

ID: 23545901
Could any one suggest a solution for my problem.

Expert Comment

ID: 23546631

a product called dbamp. You can write standard SQL queries to a SQL linked server that this product installs and directly access to query insert, update and delete to tables in your Salesforce org. That is truly the easiest way and you'll be done in a day. I use it all the time and schedule jobs to manage data. If you want to go the "integration as a service" route, check out www.boomi.com.

To do it with APEX code, there would have to be a web service deployed on your end that exposes methods to get to your database and data on your SQL server, then write the code from APEX classes that calls the webservice.

Possibly easier would be to write a program in .NET of some sort that is scheduled to run in your environment and uses the Salesforce API. You can find some sample SOAP message calls here:
where you first establish a session (login) where you are returned a key and use that throughout the rest of your calls. I use what is called the Partner WSDL so you can easily switch your code to use in multiple Salesforce organizations.

Author Comment

ID: 23546804
Thanks pauldesatadvologixdotcom:,
could you please also suggest one best way to accomplish my task in three you have proposed. I need to update nearly 43k records on a dialy basis. I think it will be a performance issue to go with webservice meothod. Could you please tell me more about the dbamp.

Thanks in Advance.

Accepted Solution

pauldesatadvologixdotcom earned 2000 total points
ID: 23547310
dbamp is an installable program on your SQL Server. It installs a SQL Server Linked Server providor. Then you just add a linked server to SQL, select the dbAmp providor, enter your authentication settings to Salesforce and you will be connected to your Salesforce org directly from the SQL Server. From there, it is as easy as writing update queries or using dbAmp provided stored procedures that are specifically writtent to help you do Bulk Updates.

Then, it's as simple as running a SQL command
Update SALESFORCE...Account
Set OwnerId = local.OwnerId
From SALESFORCE...Account
Join Account as local on local.Id = Salesforce...Account.Id
Where local.LastModifiedDate > Salesforce...Account.LastModifiedDate

OR as I said it can be accomplished using the stored procedures dbAmp provides you. If your tables are coordinated correctly the command could be as simple as:

exec dbo.BULKOPS 'SALESFORCE','Account'

You can see the dbAmp Help documentation here:

Author Closing Comment

ID: 31542594
Thank u.

Featured Post

2017 Webroot Threat Report

MSPs: Get the facts you need to protect your clients.
The 2017 Webroot Threat Report provides a uniquely insightful global view into the analysis and discoveries made by the Webroot® Threat Intelligence Platform to provide insights on key trends and risks as seen by our users.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Loops Section Overview

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question