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 ««12

Nesting xml Expand / Collapse
Author
Message
Posted Wednesday, April 2, 2014 2:44 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 10:21 PM
Points: 1,795, Visits: 4,681
Jeff Moden (4/1/2014)
Eirikur Eiriksson (4/1/2014)
Please post proper DDL and enough data, the problem is straight forward from there.


If you're going to tell people that, then you need to tell them what "proper DDL and enough data" actually means. I recommend you provide them with the first link under "Helpful Links" in my signature line below.

Thanks, point taken
Post #1557699
Posted Thursday, April 3, 2014 9:18 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, May 8, 2014 1:38 PM
Points: 8, Visits: 22
Thank you. Adding in:
Select '<?xml version="1.0"?>' + Cast((

[Original Select
]
) AS VARCHAR(MAX)) as XMLData

Worked nicely. Thank you for the information.

Warning: if you are used to clicking on the results and opening the xml into the formated view. It won't after this change. Because it puts in xml data format which behaves more like a string. Workaround Copy results or save to a file as xml. Then open up in a browser and walla, the view is like the node tree view.

Thank you again friends for your help. Happy SQL'ing to you.
Post #1558044
Posted Thursday, April 3, 2014 9:40 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 8:38 AM
Points: 5,047, Visits: 11,803
lmnorms (4/3/2014)
Thank you. Adding in:
Select '<?xml version="1.0"?>' + Cast((

[Original Select
]
) AS VARCHAR(MAX)) as XMLData

Worked nicely. Thank you for the information.

Warning: if you are used to clicking on the results and opening the xml into the formated view. It won't after this change. Because it puts in xml data format which behaves more like a string. Workaround Copy results or save to a file as xml. Then open up in a browser and walla, the view is like the node tree view.

Thank you again friends for your help. Happy SQL'ing to you.


Or CASTing it all back to XML should work, I would think.



Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #1558057
Posted Thursday, May 8, 2014 12:49 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, May 8, 2014 1:38 PM
Points: 8, Visits: 22
Hello,
I have a question about the nesting xml. Now, I want to deliver 150 rows at a time.
How can I restrict the query I have come up with to only records 1-150 then 150 to 300.



Thank you in advance.


Post #1569074
Posted Thursday, May 8, 2014 1:40 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, May 8, 2014 1:38 PM
Points: 8, Visits: 22
Sorry...But I found what will work is:

inside at my root select putting in the clause:
OFFSET 10 ROWS FETCH NEXT 5 ROWS ONLY

This will limit my results. I can change the number to what I need.

Thanks again.
Post #1569082
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse