SLAM_download_blobs
Overview
This command downloads files from ContentVersion, Attachment, or Document objects onto the file system. Provide a table with an Id column holding the Salesforce Ids of the files.
Files are downloaded to the blob directory that was configured during installation. By default this is C:\Speediful_SLAM_blob. The SQL Server Service Account must have write access to the folder. Each file is saved under its Salesforce Id with a .file extension, e.g. 00PHo00001smtyMMAQ.file and 068Ho00000f8zcXIAQ.file.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
@sObject | NVARCHAR | Required | Salesforce object type ('ContentVersion', 'Attachment', or 'Document') |
@filter_table | VARCHAR(128) | Required | Filter table containing record IDs to download. Must have an Id column |
@directory | NVARCHAR | default as per installation configuration | Target directory for downloaded files |
Usage Examples
Download ContentVersion files to default directory:
-- download record data without files
EXEC dbo.SLAM_query_bulk
@query = 'ContentVersion',
@table = 'ContentVersion_query';
-- download files
EXEC dbo.SLAM_download_blobs
@sObject = 'ContentVersion',
@filter_table = 'ContentVersion_query';
Download Attachment files to custom directory:
-- download record data without files
EXEC dbo.SLAM_query_bulk
@query = 'Attachment',
@table = 'Attachment_query';
-- download files
EXEC dbo.SLAM_download_blobs
@sObject = 'Attachment',
@filter_table = 'Attachment_query',
@directory = 'C:\MyFiles\Attachments\';
Download Enhanced Notes (ContentNotes). They are a type of ContentVersion:
-- download record data without files
EXEC dbo.SLAM_query_bulk
@query = 'SELECT * FROM ContentVersion WHERE FileType=''SNOTE''',
@table = 'ContentVersion_query_notes';
-- download files
EXEC dbo.SLAM_download_blobs
@sObject = 'ContentVersion',
@filter_table = 'ContentVersion_query_notes';
Download Document files to a custom directory:
-- download record data without files
EXEC dbo.SLAM_query_bulk
@query = 'Document',
@table = 'Document_query';
-- download files
EXEC dbo.SLAM_download_blobs
@sObject = 'Document',
@filter_table = 'Document_query',
@directory = 'C:\DocumentBackup\';