Skip to main content

SLAM_record_counts

Retrieves record counts for all Salesforce objects and stores them in the provided table name. These counts may not be real-time accurate as they are processed and cached by Salesforce on a schedule.

Parameters:

NameTypeDefaultDescription
@tableVARCHARRequiredTarget SQL table name for results
@exists_actionVARCHAR(20)NULLAction to take if the target object name specified by @table is already taken. If NULL, uses the value from SLAM_Settings.default_exists_action (defaulted to 'drop' during initial setup).

Valid options:
  • 'drop'
  • 'rename'
  • 'fail'

Usage Examples:

EXEC dbo.SLAM_record_counts @table = 'Object_Record_Counts'

SELECT * FROM Object_Record_Counts

With explicit exists action:

EXEC dbo.SLAM_record_counts
@table = 'Object_Record_Counts',
@exists_action = 'rename'