Updating Salesforce Data with SQLForce

Recently, Jeff Douglas posted about an ANSI SQL command line tool on his blog. The tool, called SQLForce, fills in some holes in SOQL. Specifically, it allows you to run commands such as UPDATE, DELETE, INSERT. You can also output data to txt files.

Jeff posted a great video of how to use it on his blog, but I prefer written steps, so here they are. CAUTION: you can really screw up your data with this tool, so make sure the command you are running is what you want.

  1. Download the most recent version in a zip file (sqlforce_1.20.5.zip) from http://code.google.com/p/sqlforce/downloads/list.
  2. Extract the zip file to an easy to access folder.
  3. Open a command prompt in the extracted sqlforce folder and then run the command java -jar sqlforce.jar
  4. Type in “HELP” to see all available commands.
  5. Connect to your Salesforce Org (I’d recommend trying it out in your sandbox first): CONNECT [PRODUCTION:SANDBOX] username password [activationKey]
  6. Wait for the connection to complete – it takes a while.
  7. Run SQL commands on your Salesforce data!

There are some good code snippets to see some of the ways to use the tool at http://code.google.com/p/sqlforce/wiki/SQLForce. One of my uses is for quick updates or deletes of certain data. For example, I had a problem with a picklist value and needed to update a bunch of records that had a certain picklist value to change it.

2 thoughts on “Updating Salesforce Data with SQLForce”

Leave a Reply