Is there an alternate way to pass node elements dynamically than the one shown below - ?
select XMLTable.XMLCOL.query('//*[local-name()=sql:variable("@node")')
For e.g., even if I am trying to give the fully qualified path, I do not want to hard code the node elements, instead I would like to pass them individually as parameters.
Under the section -
Example: Query Using sp_executesql
@ http://msdn.microsoft.com/en-us/library/ms345118(v=sql.90).aspx
it says -
query contains wildcards (*) and node tests using node names and is hard to optimize well. Consequently, it performs much worse than the original query and the query construction approach.