Enables or disables, at the session level, the replication of update, delete, insert select, or select into as SQL statements.
set repmode {“on” SQLDML_option | “never” | “off” | ‘threshold’, ‘value’}
SQLDML_option ::= { U | D | I | S }
SQL replication settings defined using set repmode overrides those defined using sp_setrepdbmode or sp_setrepdefmode.
set repmode on 'DS'
set repmode never
set repmode on 'U' go sp_setrepdefmode tabname, on, 'UDI' go
set repmode ‘threshold’, ‘1000’ go
You can set the session-level options either at login by using a “login trigger”, or at the beginning of a batch. Your session settings overwrites the table or database settings.
Session-level settings are active only for the duration of the session. When you set the options inside a stored procedure or a trigger, the settings are reverted back to the table-level or database-level settings when the stored procedure or trigger execution terminates.