November 20, 2014 at 6:59 am
I have a table with an indexed XML column. Is it possible to use openxml that takes advantage of the indexes in the table? To my knowledge, openxml only works for xml variables. Or, a different question, is it possible to create xml indexes on a xml variable?
November 20, 2014 at 8:58 am
N_Muller (11/20/2014)
I have a table with an indexed XML column. Is it possible to use openxml that takes advantage of the indexes in the table? To my knowledge, openxml only works for xml variables. Or, a different question, is it possible to create xml indexes on a xml variable?
Quick question, why are you using openxml?
😎
November 20, 2014 at 9:02 pm
As far as I know there are two ways of reading XML using SQL, either openxml or XQuery. There's a lot of debate on which is better or faster. Certainly, openxml makes the code easier to read. I know I can use XQuery and take advantage of the XML indexes in tables. I wanted to know if there is such possibility using openxml.
November 21, 2014 at 12:40 am
N_Muller (11/20/2014)
As far as I know there are two ways of reading XML using SQL, either openxml or XQuery. There's a lot of debate on which is better or faster. Certainly, openxml makes the code easier to read. I know I can use XQuery and take advantage of the XML indexes in tables. I wanted to know if there is such possibility using openxml.
Sorry I didn't phrase the question properly, meant to ask if there where any technical limitations or requirements forcing the use of openxml.
Back to the initial question, XML index cannot be created on a variable and it is unlikely that an XML index is going to be helpful for openxml, I strongly recommend using XQuery with the nodes function instead.
😎
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply