Modifies text, unitext, or image data in a replicate database.
create function string blurbs_rep.rs_writetext;copy for gw_function_class output rpc 'execute update_blurbs_copy @copy_chunk = ?copy!new?, @au_id = ?au_id!new?, @last_chunk = ?rs_last_text_chunk!sys?, @writetext_log = ?rs_writetext_log!sys?'
create function string blurbs_rep.rs_writetext;copy for rs_sqlserver2_function_class output writetext use primary log
create function string blurbs_rep.rs_get_textptr;copy for sqlserver2_function_class output language 'select repcopy from blurbs where au_id = ?au_id!new?'
create function string blurbs_rep.rs_writetext;copy for rs_sqlserver2_function_class output none
rs_writetext has replication definition scope.
For each replicated text, unitext, or image column in a replication definition, Replication Server generates an rs_writetext function string for the rs_sqlserver_function_class and rs_default_function_class classes when you create the replication definition.
If you use a user-created function-string class, create an rs_writetext function string for each replicated text, unitext, or image column included in the replication definition.
Create or customize an rs_writetext function string at the Replication Server where you created the replication definition.
Replication Server supports three output formats for creating an rs_writetext function string: RPC, writetext, and none.
Using the RPC Method
With the RPC method for creating an rs_writetext function string, Replication Server executes a remote procedure call repeatedly, providing up to 255 bytes of the text, unitext, or image value on each procedure execution.
The data is passed in the RPC in a varchar parameter for text or unitext data or in a varbinary parameter for image data. Replication Server ensures that the data chunks are partitioned on character boundaries for text or unitext columns. If a 1-byte character set is in use, the data is sent in 255-byte chunks.
Another int system variable, rs_writetext_log, is set to 1 if the writetext logging option was used in the primary database or 0 if the logging option was not used in the primary database.
The values of other columns in the data row can be accessed by using the new or old modifier. If you used the Transact-SQL insert command at the primary database, you must use the new modifier.
Use the text_status modifier to retrieve the status of a text, unitext, or image column. For a description of the text_status modifier, see "rs_datarow_for_writetext."
Using the writetext Method
The writetext method for creating an rs_writetext function string provides the options shown in the following table to specify the logging behavior in the replicate database.
Logging Option |
Description |
---|---|
use primary log |
Log the data in the replicate database transaction log if the logging option was specified in the primary database transaction log. Do not log if logging is not specified in the primary database transaction log. |
with log |
Log the data in the replicate database transaction log. |
no log |
Do not log the data in the replicate database transaction log. |
The default function string for rs_sqlserver_function_class uses the use primary log option.
Using the none Method
The none output template option for rs_writetext function strings instructs Replication Server not to use the Client-Library function ct_send_data to update a text, unitext, or image column value. This option provides necessary flexibility for using text, unitext, or image columns in a heterogeneous environment.
See the Replication Server Administration Guide Volume 2 for more information.