August 25, 2009 at 11:55 am
Hello all, I am working on a task in which, I need to generate XML output out of a SQL Database. I am using FOR XML clause and generating output using BCP. I have XML file but this file is without LineFeed.
There are no Linefeeds after each End Tag in the XML. How can I add Line-feed into this XML??
Please this is urgent. Respond at your earliest.
Thank you very much.
-RP
August 25, 2009 at 12:08 pm
For XML won't do line-feeds because XML files don't need them. That's what tags are for.
Why do you need line-feeds in XML?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
August 25, 2009 at 2:23 pm
Hello GSquared,
Yes, we don't need it for XML, but i need to add line feed after every end tag. We are sending these xml files to third party for further processing and they need us to insert line feed after every end tag because of large size of the files. They need to truncate these files to process further.
So, I need to add line feed after each end tag on XML.
Is it feasible?
Thank you for your response.
Regards,
-RP
August 25, 2009 at 2:32 pm
If you store the XML as varchar(max) instead of as XML, you could use Replace to add line-breaks after certain tags. Would that do what you need?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
August 25, 2009 at 2:38 pm
That doesn't make sense. Adding characters to a file because it is too big! How do you go about truncating a self-describing file?
You can't do this with the FOR XML statement and BCP. The only thing I can think of is to open the file and programatically add the line feeds.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply