この XML SQL を C# で実行すると、エラーが発生します。何が欠けている?SQL Server 管理スタジオでは問題なく動作しますが、c# では動作しません。
protected DataTable ServiceCodes(string orderColumn = default(string), bool orderAscending = true)
{
string sql = @" SELECT DISTINCT(Split.a.value('.', 'VARCHAR(100)')) AS Data
FROM
(
SELECT CAST('<M>' + REPLACE(Text09, ',', '</M><M>') + '</M>' AS XML) AS Data
FROM Assets
WHERE Category = 'Service'
) AS A CROSS APPLY Data.nodes ('/M') AS Split(a) ORDER BY Data";
return DatabaseConnection.ExecuteDataTable(sql, 120000);
}