I have an issue getting data from SQL Server when FOR XML is used in the query.
For example
select Code, Name from Products for xml path('Product'), root('Products')
Stepping through the workflow it retrieves the result, but it seems returned as binary rather than text, also as multiple rows.
Then when you use something like the Write to File action I get the error
"mismatch with column typeCouldn't store <System.Collections.Generic.List`1[System.Object]> in XML_F52E2B61-18A1-11d1-B105-00805F49916B Column. Expected type is Byte[]."
If I change the SQL statement to return the data in JSON format, i.e. FOR JSON, not a problem. The results are again returned as multiple rows, but the Write To File action creates me a file.
Any Ideas?

Report
All responses (
Answers (