Truncates a table in a replicate database.
Replaces the existing rs_truncate function string for the authors table with one that executes a Transact-SQL delete command, which logs all deletions, instead of the truncate table command, which does not log deletions.
alter function string authors.rs_truncate for sqlserver_derived_class output language 'delete authors'
You would want to customize the rs_truncate function string for the authors table, if:
The replicate database doesn’t support table the Transact-SQL truncate table command, or
You want to have deletions logged at the replicate database.
Replication Server executes rs_truncate to truncate a table.
The rs_truncate function has replication definition scope.
Replication Server generates an rs_truncate function string for the system-provided function string classes when you create the replication definition.
If you use a user-created base function string class, create an rs_truncate function string for each replication definition.
Create or customize an rs_truncate function string at the Replication Server where you created the replication definition.
The default-generated function string for rs_truncate, for the rs_sqlserver_function_class and rs_default_function_class classes for each replication definition, uses the Transact-SQL truncate table command syntax. It deletes all rows in a table without logging the deletion of each individual row.
alter function string, rs_datarow_for_writetext, rs_get_textptr, rs_insert, rs_delete, rs_textptr_init, rs_writetext, set autocorrection