Skip to main content
Update
Updated over 3 months ago

Create a load table

This example creates a load table called "Account_TestLoad_Upsert". The Id and Error columns are mandatory. All load operations require the Error column, whether success or failure, to guide and inform you. Update requires a populated Id column.

drop table if exists Account_TestLoad_Update
select
Id
,convert(nvarchar(255),null) as Error
,convert(bit,1) as TestCheckbox__c
-----
,TestCheckbox__c as TestCheckbox__c_Orig
-----
,'HelperTextExample' as RandomAdditionalText_Info
into Account_TestLoad_Update
from Account

In this example, the Update payload has been generated from the prior replicated Account table. The field "TestCheckbox__c" is currently set to 0 / FALSE. The script above has prepared an update payload, setting to 1 / TRUE. As a good practice, to preserve the original value in the payload table, we recommend you embed the original value to keep a record of the value prior to the update change.

This example also illustrates that you can have "helper" columns also in the payload.

SQL Sales best practise is to have original values included, with a "_Orig" (for original) suffix added to the column name. Similarly informational columns, useful in working with the payload should have the suffix "_Info" (for information).

To be clear, these suffix conventions are not expected or mandatory whatsoever, we just try and encourage their use, but of course, how you use SQL Sales is up to you.

Note, to get near real time accuracy, it is recommended to run a ss_Delta just before you grab the Account data (for this particular example which is sourcing from Salesforce itself).

Running the example

exec ss_Loader 'Update','DEMO','Account_TestLoad_Update'

SQL-SALES Update run date: 2023-11-04 ---------------------------

19:03:54: Using Env|Schema: DEMO|dbo

19:03:55: Starting Loader for Account batchsize 200

19:03:55: SSId added to Account_TestLoad_Update

19:03:58: Connection method BULK & SOAP API

19:03:58: Columns checked against Salesforce metadata

19:04:11: Excluded: RandomAdditionalText_Info is not available on object Account

19:04:11: Excluded: TestCheckbox__c_Orig is not available on object Account

19:04:11: Load complete: Success:1801 Failure:0

-----------------------------------------------------------------

Note the reported column exclusions:

Excluded: RandomAdditionalText_Info is not available on object Account

Excluded: TestCheckbox__c_Orig is not available on object Account

Did this answer your question?