Tuesday, May 29, 2007 9:33 PM
richard
SQL Server 2005 XQuery does not implement XQuery 1.0 / XPath 2.0 fully
A coworker of mine was trying to apply the XPath 2.0 upper-case() function to some shredded xml from a query in SQL Server 2005 and inquired about it with me just before heading out the door.
Here's what's happening: You try to apply the upper-case function (that exists in the XQuery 1.0 / XPath 2.0 standard) to, say, the result from a .value() method call on some stored xml and you get this lovely message:
Msg 2395, Level 16, State 1, Line 4
XQuery [value()]: There is no function '{http://www.w3.org/2004/07/xpath-functions}:upper-case()'
And turns out it's not lying.... per Michael Rys in this post on microsoft.public.sqlserver.xml the standard is not fully implemented (even though it refers to it in the error message, and browsing http://www.w3.org/2004/07/xpath-functions does show upper-case() as a function). But SQL Server only supports:
concat
contains
substring
and
string-length
on strings :(