• L' Eomot Inversé (7/29/2013)


    if I need to know I can either play (if I have a SQL Server instance I can play with handy) or look it up (if I have internet access handy)

    True. The reason I still think it's good to know is not for the scenario where you get someone else's code and are wondering what the data function does (I would handle that exactly the same way you do), but for the scenario where you are given a task that might benefit from this function. Admittedly, the behaviour of the function is weird enough that it's hard to think of a realistic use case - but if you do run into one and don't remember that such a function exist, you might find yourself working very hard to reproduce this behavior using other XQuery expressions. Whereas in that situation, if you do happen to know that there is a function to do just that (even if you perhaps forgot the name and have to google for it), you'll save a lot of time and effort.

    I share your antipathy (or should I say hatred?) of XML and XQuery. But matter of fact is, it is a part of the product I work with, and it's my professional responsibility to ensure I have at least sufficient working knowledge to handle things if they come up.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/