Re: using a xpath variable in a replace xquery, getting an error



I thought I'd be able to get around it with the nodes command but no
go:

SELECT T.c.query('.') AS XmlResult
FROM @xml.nodes('sql:variable("@xpath")') T(c)

Same error. It works if I put in the xpath itself. Now I'm really
ticked because I spent a solid day developing a trigger in my database
that was based on xpath variables as an input. Guess what: you can't do
that. You apparently can't even build up a string or anything.

It's a literal hardcoded xpath or nothing. Now where in all of the .NET
world will you find similar behavior? Can't think of any place.

.


Loading