diff --git a/plugins/dbgate-plugin-mssql/src/frontend/driver.js b/plugins/dbgate-plugin-mssql/src/frontend/driver.js index 3f7c8b56..feca80c9 100644 --- a/plugins/dbgate-plugin-mssql/src/frontend/driver.js +++ b/plugins/dbgate-plugin-mssql/src/frontend/driver.js @@ -86,6 +86,24 @@ const dialect = { }, }; } + if (dataType && dataType.toUpperCase() == 'XML') { + return { + exprType: 'call', + func: 'CONVERT', + alias: alias || columnName, + args: [ + { + exprType: 'raw', + sql: 'NVARCHAR(MAX)', + }, + { + exprType: 'column', + columnName, + source, + }, + ], + }; + } }, };