The <Comments/> element does not have a text() node, you must do insert , not replace :
update @t1 set userdef.modify(' insert text{"NO COMMENTS"} into (/Orders/Document/Comments[1])[1] ') where id = @id;
If you want to insert text from an sql variable, you can use the following construction:
declare @comments varchar(1000); set @comments = 'NO COMMENTS'; update @t1 set userdef.modify(' insert text {sql:variable("@comments")} into (/Orders/Document/Comments[1])[1] ') where id = @id;
i-one source share