SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL Server 2008 and XML


SQL Server 2008 and XML

Author
Message
Sreepathi1987
Sreepathi1987
SSC Eights!
SSC Eights! (997 reputation)SSC Eights! (997 reputation)SSC Eights! (997 reputation)SSC Eights! (997 reputation)SSC Eights! (997 reputation)SSC Eights! (997 reputation)SSC Eights! (997 reputation)SSC Eights! (997 reputation)

Group: General Forum Members
Points: 997 Visits: 310
Comments posted to this topic are about the item SQL Server 2008 and XML
Lokesh Vij
Lokesh Vij
SSCarpal Tunnel
SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)

Group: General Forum Members
Points: 4738 Visits: 1599
Simple but tricky question :-)

~ Lokesh Vij

Guidelines for quicker answers on T-SQL question
Guidelines for answers on Performance questions

Link to my Blog Post --> www.SQLPathy.com

Follow me @Twitter


Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (110K reputation)SSC Guru (110K reputation)SSC Guru (110K reputation)SSC Guru (110K reputation)SSC Guru (110K reputation)SSC Guru (110K reputation)SSC Guru (110K reputation)SSC Guru (110K reputation)

Group: General Forum Members
Points: 110380 Visits: 13338
This question could have been so much more than just a simple trick question. Instead of focusing on attribute or element centric mapping (which you did a bit with the answers and by specifying a non-existant bit flag), you made the question a whole lot less interesting.
The explanation doesn't even mention the different mappings and how they affect results.


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
Stewart "Arturius" Campbell
Stewart "Arturius" Campbell
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27192 Visits: 7545
Koen Verbeeck (8/1/2012)
This question could have been so much more than just a simple trick question. Instead of focusing on attribute or element centric mapping (which you did a bit with the answers and by specifying a non-existant bit flag), you made the question a whole lot less interesting.
The explanation doesn't even mention the different mappings and how they affect results.

+1

Hard to believe that the OPENXML is still so prevalently used, what with the addition of the XML data type (and the related xQuery and xPath functions) in SQL2005.

____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
hakan.winther
hakan.winther
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3731 Visits: 612
I knew it couldn't be a simple answer, but I answered based on what it should have been if it wouldn't have been the CASE difference. I don't like questions where you have to look at case or spelling issues.

/Håkan Winther
MCITPBigGrinatabase Developer 2008
MCTS: SQL Server 2008, Implementation and Maintenance
MCSE: Data Platform
Thomas Abraham
Thomas Abraham
SSCarpal Tunnel
SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)

Group: General Forum Members
Points: 4967 Visits: 2256
Thanks for submitting the question. But, my general reaction amounted to a yawn. Your focus on case made the question seem even less interesting. Also, if you use a screen shot, how about not using the entire screen? Keep trying.

Please don't go. The drones need you. They look up to you.
Connect to me on LinkedIn
Tom Thomson
Tom Thomson
SSC-Dedicated
SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)

Group: General Forum Members
Points: 39221 Visits: 12880
I got it right, but I don't like this question.

Where (if anywhere) is it dosumented how that flag-byte 7 behaves? Nowhere, so the question is asking people to guess what it meansor carry out experiments to discover what it means. People can deduce that it doesn't mean "error" because that is not one of the options given. But they can't deduce what it actually does mean.

Suppose the 3rd bit (starting at LS end) meant "ignore case in paths", and the second bit means "ignore bit 1" as well as what the book says: then the answer would be three rows of nulls. Alternatively suppose the 4 bit means "ignore case in paths" but the 2 bit says "ignore me if bit 1 is set" as well as what the book says it means; then the answer would be three rows with non-null values. Neither of these is the correct answer, but you can't tell that from the documentation. Note that either the 2 bit overrides the 1 bit or the 1 bit overrides the 2 bit or we get an error when both are set; as we don't get an error, people can deduce that there is something undocumented is happening.

In fact the 4 bit doesn't mean anything (so far as I can tell - I can't prove it, I've played around enough to believe it but not enough to be reaonably sure of it), and the 2 bit overrides the 1 bit (at least some of the time; I suspect all the time). But how are people expected to know that, without going and playing with it?

In a context other than QotD, I would definitely approve of a question that makes people go and play with things to get the answer, but I think QotD should require at most a bit of research in the documentation and people mostly won't have time to do more than that, so this question is going to leave people to make a guess or decline to answer (apart from a few, like me, who have already played around a bit). I don't like that.

Tom

(Bob Brown)
(Bob Brown)
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1223 Visits: 1145
Great question. I'm getting more into XML from SQL and this was a good test.
Mike Is Here
Mike Is Here
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2148 Visits: 515
Good question, I knew the answer from personal experience. Blush
sestell1
sestell1
SSCarpal Tunnel
SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)

Group: General Forum Members
Points: 4897 Visits: 3580
L' Eomot Inversé (8/1/2012)
I got it right, but I don't like this question.

Where (if anywhere) is it dosumented how that flag-byte 7 behaves? Nowhere, so the question is asking people to guess what it meansor carry out experiments to discover what it means. People can deduce that it doesn't mean "error" because that is not one of the options given. But they can't deduce what it actually does mean.

Suppose the 3rd bit (starting at LS end) meant "ignore case in paths", and the second bit means "ignore bit 1" as well as what the book says: then the answer would be three rows of nulls. Alternatively suppose the 4 bit means "ignore case in paths" but the 2 bit says "ignore me if bit 1 is set" as well as what the book says it means; then the answer would be three rows with non-null values. Neither of these is the correct answer, but you can't tell that from the documentation. Note that either the 2 bit overrides the 1 bit or the 1 bit overrides the 2 bit or we get an error when both are set; as we don't get an error, people can deduce that there is something undocumented is happening.

In fact the 4 bit doesn't mean anything (so far as I can tell - I can't prove it, I've played around enough to believe it but not enough to be reaonably sure of it), and the 2 bit overrides the 1 bit (at least some of the time; I suspect all the time). But how are people expected to know that, without going and playing with it?

In a context other than QotD, I would definitely approve of a question that makes people go and play with things to get the answer, but I think QotD should require at most a bit of research in the documentation and people mostly won't have time to do more than that, so this question is going to leave people to make a guess or decline to answer (apart from a few, like me, who have already played around a bit). I don't like that.


+1

Interesting question, but...
I answered the question correctly based on the fact that the root didn't have the correct case, but only after I gave up trying to find documentation on the flag value of 7 and tested the flag values effect on some xml code I had.

If it was the case sensitivity of the rowpattern, I would have used simple documented values for the flag. If the point of the question was the behavior of the undocumented flag value, I personally would have set up the code in the question to allow copy-paste for experimentation, since there would be no other way to determine it's behavior.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search