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