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


XML


Author
Message
VM-723206
VM-723206
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1284 Visits: 267
Comments posted to this topic are about the item XML
vk-kirov
vk-kirov
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: 4858 Visits: 4408
It cannot be used as a parameter to any scalar, built-in functions other than ISNULL, COALESCE, and DATALENGTH

What about CAST/CONVERT? These functions are scalar, built-in; XML data type can be used as a parameter to these functions. So I guess that the third statement of QotD is not correct.
Mauve
Mauve
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: 4880 Visits: 2070
The System Functions are classified as Scalar Functions.
Reference BOL:
Scalar Functions: http://technet.microsoft.com/en-us/library/ms174318(SQL.90).aspx
System Functions: http://technet.microsoft.com/en-us/library/ms187786(SQL.90).aspx

Using a System Function such as CAST and CONVERT against an xml data type is permitted. Ref:
http://technet.microsoft.com/en-us/library/ms189887(SQL.90).aspx

Therefore, the BOL entry referenced by the answer is incorrect. Since the documentation is conflicting but certain scalar operations are permitted, the provided answer is incorrect.


(PHB) I think we should build an SQL database. (Dilbert) What color do you want that database? (PHB) I think mauve has the most RAM.
RBarryYoung
RBarryYoung
SSC Guru
SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)SSC Guru (54K reputation)

Group: General Forum Members
Points: 54834 Visits: 9518
You know these multi-select questions are much more difficult than the multiple choice ones. I think that they should always be worth at least two points.

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Bhavesh_Patel
Bhavesh_Patel
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1065 Visits: 297
Pure guess work - I am never used XML datatype



Bhavesh Patel

http://bhaveshgpatel.wordpress.com/
Tom Thomson
Tom Thomson
SSC-Dedicated
SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)

Group: General Forum Members
Points: 35861 Visits: 12787
vk-kirov (6/16/2009)
It cannot be used as a parameter to any scalar, built-in functions other than ISNULL, COALESCE, and DATALENGTH

What about CAST/CONVERT? These functions are scalar, built-in; XML data type can be used as a parameter to these functions. So I guess that the third statement of QotD is not correct.


I took the cynical view that because the second part was correct and most people don't think of cast and convert as scalar functions but as something quite different (in the case of CAST, they are probably right, ie BOL is probably wrong, as it looks like a coercion context marker and not a function of any kind; it would probably be stretching it rather a lot to say the same of convert though, so BOL is right about convert) the question author would probably not have considered CAST and convert as scalar functions and would want the wrong answer. So I ticked all three boxes,found my cynical guess was right, and came to the discussion to make exactly the comment you made, only to find that two people had beat me to it.

Tom

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