none
Alternative to For XML RRS feed

  • Question

  • I am trying to do some Pivot like FOR xml path in Azure dataware house, however I got syntax error

    and which the same data, same table, same query works fine in SQL Server (on-prem)

    Any idea ?

    SELECT

    DISTINCTcol1,


       

    STUFF((


               

    SELECT','+PO_A.col2

               

    FROMtesting11 PO_A

               

    WHEREPO_A.col1 =PO_B.col1

               

    FORXMLPATH('')


               

    ),1,1,'')ASOwners


    FROM

    testing11 PO_B

    Monday, August 5, 2019 9:21 AM

All replies

  • anyone has the idea ?
    Monday, August 5, 2019 11:56 AM
  • Hi Sakurai_db,

    This is unsupported in Azure SQL Data Warehouse per the following document: Workarounds for unsupported data types (link). So, XML needs to be loaded as VARCHAR using the following method: Designing a PolyBase data loading strategy for Azure SQL Data Warehouse (link).

    Please let us know if you have additional questions.

    Regards,

    Mike

     

    Tuesday, August 6, 2019 12:19 AM
    Moderator