June 9, 2003 at 3:23 am
As with most software topics these days, there is a plethora of information on producing XML format through SQL searches. However, I am unable to find a SQL search format for producing results in the following basic format:
<Root>
<attribute1>element<attribute2>
<attribute2>element<attribute2>
</Root>
Can anyone assist me with the query required for the SQL Query Analyser?
June 9, 2003 at 3:28 am
Have a look in BOL at FOR XML EXPLICIT.
Quite powerfull.
It allowes you to mix and match nodes with attributes.
Cheers,
Crispin
Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!
June 9, 2003 at 3:39 am
..will do, nice to know things are still operational in Johies after the nail biter against Scotland on the w/e
June 9, 2003 at 3:53 am
lol.
If this topic turns to rugby, you'll have most American viewrs searching through BOL for the RUGBY function
Cheers,
Crispin
Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!
June 9, 2003 at 4:09 am
That's the function that takes rug marketing data and ensures a break down by type...right?
June 9, 2003 at 4:12 am
That's the one.
Only avaliable in 2K South African Edition.
Cheers,
Crispin
Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!
June 9, 2003 at 4:15 am
Thought so. They only give us the buggy versions of SQL here in the US. Think their still mad about the anti-trust stuff and the day Bill got his just desserts (pie-in-the-face-day).
June 9, 2003 at 4:24 am
..you guys have digressed from my query, but it looks like FOR XML should do the trick.
..I know this is subjective, but I reckon passing the ball forward during sport reduces the complexity of the game
June 9, 2003 at 4:27 am
This is true but indo so, it keeps a lot of countries out of the sport.
Cheers,
Crispin
Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!
June 9, 2003 at 4:39 am
True, but should the objectives of a sporting code be to be played by and appeal to all nations. It is great for athletics and such, however for certain sports I think it is good to retain ethnic and regional traditions and keep 'em tribal. Talk about digression....!
June 9, 2003 at 4:53 am
Thanks Crispin, the Query I was looking for is:
Select * from (tablename) for XML Auto, Elements
Cheers
June 9, 2003 at 5:04 am
ahhh. That was the easy route 🙂
What I thought you want was:
<ROOT>
<ElementName ATTR1="xxx">Some Value1</ElementName>
<ElementName ATTR1="yyy">Some Value2</ElementName>
<ElementName ATTR1="aaa">Some Value3</ElementName>
<ElementName ATTR1="bbb">Some Value4</ElementName>
</ROOT>
You can get a lot done with EXPLICIT but it took me a while to understand it.
Cheers,
Crispin
Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!
June 9, 2003 at 5:10 am
a boer maak a plan!
loosely translated = a farmer will make a plan!
June 9, 2003 at 5:14 am
Maar n engelsman maak a plan wat werk... (But an englishman make a plan that works)
Cheers,
Crispin
Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!
June 9, 2003 at 10:56 am
Fascinating have I fallen into a alt.sports.boer newsgroup by mistake?
You'll need to do
Select * from (tablename) as ROOT for XML Auto, Elements
if you want <ROOT> around your output.
Viewing 15 posts - 1 through 15 (of 15 total)
You must be logged in to reply to this topic. Login to reply