SQL Server: Replace invalid XML characters from a VARCHAR(MAX) field

前端 未结 3 756
余生分开走
余生分开走 2020-12-03 12:06

I have a VARCHAR(MAX) field which is being interfaced to an external system in XML format. The following errors were thrown by the interface:

3条回答
  •  没有蜡笔的小新
    2020-12-03 12:54

    It is safe to use VARCHAR(MAX) as my data column is a VARCHAR(MAX) field. Also, there will be an overhead of converting VARCHAR(MAX) to NVARCHAR(MAX) if I pass a VARCHAR(MAX) field to the SQL function which accepts the NVARCHAR(MAX) param.

    Thank you very much @RhysJones, @Damien_The_Unbeliever for your comments.

提交回复
热议问题