Bill Fellows on Nostr: Me reading the docs and applying the syntax to my query. WTF, why doesn't this work? ...
Me reading the docs and applying the syntax to my query. WTF, why doesn't this work?
30 minutes later, having picked the query apart. FINE, let me get on a server with AdventureWorks and run the query from BoL.
The documentation is wrong (or SQL Server behaviour changed between 2012 and now w/r/t subqueries with FOR XML PATH)
Specifically, "Generate a list using PATH mode" the second subquery for ProductNames results in XML safe instead of a merged result as shown https://learn.microsoft.com/en-us/sql/relational-databases/xml/examples-using-path-mode?view=sql-server-ver16#generate-a-value-list-using-path-mode
30 minutes later, having picked the query apart. FINE, let me get on a server with AdventureWorks and run the query from BoL.
The documentation is wrong (or SQL Server behaviour changed between 2012 and now w/r/t subqueries with FOR XML PATH)
Specifically, "Generate a list using PATH mode" the second subquery for ProductNames results in XML safe instead of a merged result as shown https://learn.microsoft.com/en-us/sql/relational-databases/xml/examples-using-path-mode?view=sql-server-ver16#generate-a-value-list-using-path-mode