Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 123»»»

XML Workshop 26 – SELECT * FROM XML Expand / Collapse
Author
Message
Posted Tuesday, June 29, 2010 9:51 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, December 24, 2013 4:42 AM
Points: 460, Visits: 2,523
Comments posted to this topic are about the item XML Workshop 26 – SELECT * FROM XML

.
Post #945181
Posted Wednesday, June 30, 2010 12:51 AM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, February 4, 2014 4:31 AM
Points: 60, Visits: 274
Great Article. I really enjoy reading this.

Many thanks for thinking 'SELECT *'. I agree that Select * now means bring me everything.

Kind Regards,



Kindest Regards,

Pinal Dave
sqlauthority.com
Post #945234
Posted Wednesday, June 30, 2010 1:23 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, August 8, 2013 1:54 AM
Points: 7, Visits: 34
what about querying attributes?
Post #945248
Posted Wednesday, June 30, 2010 1:55 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, December 24, 2013 4:42 AM
Points: 460, Visits: 2,523
Yes, you can also query attributes.

.
Post #945267
Posted Wednesday, June 30, 2010 2:14 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, August 8, 2013 1:54 AM
Points: 7, Visits: 34
can you show an example of querying attributes please?
thanks in advance
Post #945284
Posted Wednesday, June 30, 2010 3:01 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, December 24, 2013 4:42 AM
Points: 460, Visits: 2,523
Here is a simple example:
DECLARE @xml XML
SELECT @xml = '<employee name="jacob"/>'
SELECT * FROM XMLTable(@xml)
WHERE NodeType = 'attribute'



.
Post #945311
Posted Wednesday, June 30, 2010 3:18 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, September 29, 2011 8:53 AM
Points: 1, Visits: 21
Thank you! very useful!
Post #945316
Posted Wednesday, June 30, 2010 3:25 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, September 19, 2014 7:51 AM
Points: 19, Visits: 155
Excellent - I can see this being very useful.

There's a couple of typos in the function definition if your server happens to be case sensitive.

Line 087 p.position should be p.Position
Line 166 XmlData should be XMLData



Post #945318
Posted Wednesday, June 30, 2010 3:35 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, December 24, 2013 4:42 AM
Points: 460, Visits: 2,523
Thanks, Fixed both places.

.
Post #945321
Posted Wednesday, June 30, 2010 4:06 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, September 19, 2014 7:51 AM
Points: 19, Visits: 155
Fast work - thanks!


Post #945332
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse