Actually a careful reading of the doc that was linked to (here) logically implies that .WRITE(NULL,NULL,NULL)
should try to truncate the column to the length that it already is. I.E., effectively a no-op.
Note the italicized sections in this extract from the Doc:
.WRITE (expression,@Offset,@Length)
:Specifies that a section of the value of column_name is to be modified. expression replaces @Length units starting from @Offset of column_name. ...
expression
: is the value that is copied to column_name. ... If expression is set to NULL, @Length is ignored, and the value in column_name is truncated at the specified @Offset.
@Offset
: is the starting point in the value of column_name at which expression is written. ... If @Offset is NULL, the update operation appends expression at the end of the existing column_name value and @Length is ignored. ...
So if @Offset
is NULL, then it is treated as though it were the current length of the column.
And, if expression
is NULL, the column is truncated at the @Offset
value.
Ergo, if both are NULL, then the column is truncated at its current length. Which I take to mean that it effectively does nothing.