sys.sp_copy_data_in_batches

general
#stored-procedure

Description

Copies data from the source table to the target table after verifying that their schema is identical in terms of number of columns, column names and their data types. columns are ignored since they’re system generated and this allows copying data from a regular table to a ledger table and vice versa. Indexes between the tables can be different but the target table can only be a heap or have a clustered

Syntax

sp_copy_data_in_batches
[ @source_table_name = ]
N
'source_table_name'
, [ @target_table_name = ]
N
'target_table_name'