Skip to main content
Delete
Updated over 3 months ago

Create a load table

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

drop table if exists Account_TestLoad_Delete
select
Id
,convert(nvarchar(255),null) as Error
,Name
-----
,'HelperTextExample' as RandomAdditionalText_Info
into Account_TestLoad_Delete
from Account

In this example, the Delete payload has been generated from the prior replicated Account table. Additional fields (for example "Name" and "RandomAdditionalText_Info") can be included in the payload, if required or necessary for your particular use case. The Delete operation will ignore (but preserve) them as it is only concerned with the Id and Error fields.

This example also illustrates some failure scenarios.

Running the example

exec ss_Loader 'Delete','DEMO','Account_TestLoad_Delete'

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

19:23:17: Using Env|Schema: DEMO|dbo

19:23:17: Starting Loader for Account batchsize 200

19:23:17: SSId added to Account_TestLoad_Delete

19:23:20: Connection method BULK & SOAP API

19:23:20: Columns checked against Salesforce metadata

19:23:57: Load complete: Success:1791 Failure:10

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

Note the failures being reported in this example

Here we can see the standard data provided by Salesforce in the Developer instance cannot be deleted due to referential integrity validation constraints and reported back via the Salesforce api to SQL Sales and in turn the Error column.

Did this answer your question?