Skip to main content

SLAM_abort

Overview

Stops a running SLAM operation from another SQL session. This is useful when a long-running operation needs to be cancelled, such as a large data load or bulk query.

SLAM_abort works by looking up the Windows process ID from the SLAM_Activity_Log table and terminating the process. The aborted operation's activity log entry is marked as completed, and a separate abort entry is logged.

important

The SLAM_Activity_Log table must exist before using SLAM_abort. Install it by running SLAM_20_activity_log.sql.

warning

SLAM_abort performs an immediate, ungraceful shutdown of the operation. This can leave Salesforce and SQL Server in an inconsistent state:

  • Data synchronization: Results from in-progress load or query operations may not have been written back to SQL Server, even though Salesforce may have partially processed the data.
  • Bulk API jobs: Aborting does not cancel bulk jobs already submitted to Salesforce. Data loads and queries will continue to process on the Salesforce side.
  • Temporary tables: Working tables created during the operation may be left behind.

The original SQL session that launched the operation will receive an error indicating the process was terminated.

Parameters

NameTypeDefaultDescription
@process_idINT-1Windows process ID of the SLAM operation to abort. When set to -1 (default), aborts the most recent operation started within the last 48 hours

Usage Examples

Abort the most recent running operation:

-- From a separate SQL session:
EXEC dbo.SLAM_abort

Abort a specific operation using its process ID:

-- Find the process ID from the Activity Log
SELECT TOP 5 ProcessId, Operation, StartDate, EndDate
FROM SLAM_Activity_Log
ORDER BY StartDate DESC

-- Abort the specific operation
EXEC dbo.SLAM_abort @process_id = 12345
tip

The ProcessId column in SLAM_Activity_Log identifies the Windows process running each operation. Operations that have completed will have a non-NULL EndDate. Only operations started within the last 48 hours are considered.