What retard thought up FOR EXPLICIT in SQL Server 2000?
  Home FAQ Contact Sign in
microsoft.public.sqlserver.xml only
 
Advanced search
POPULAR GROUPS

more...

microsoft.public.sqlserver.xml Profile…
 Up
What retard thought up FOR EXPLICIT in SQL Server 2000?         


Author: stork
Date: Oct 3, 2006 10:48

There's no need to have the Parent and the Tag elements if you have the
universal table already defined. Couldn't they have just used the
[blah!blah!blah!] syntax and did something like this:

SELECT
a.custid as [Customer!Id],
a.custname as [Customer!CustomerName],
b.ordernumber as [Order!OrderNumber],
c.partnumber as [Part!PartNumber]
FROM
Customer A, Order B, OrderPart C
WHERE
A.custid = B.custid AND
B.ordernumber = C.ordernumber
ORDER BY custid, custname, ordernumber, partnumber

In the above example, you wind up with the ultimate table with only one
frigging query, not FOR EXPLICIT abortion of N number of queries
stitched together with the union... from there, you can go, left to
right, assuming that each column is either an element or an attribute,
which you can get by looking at the bang bang hack "Customer!Id".
Show full article (1.11Kb)
1 Comment
Re: What retard thought up FOR EXPLICIT in SQL Server 2000?         


Author: Kent Tegels
Date: Oct 3, 2006 12:31

Hello stork,
s> There's no need to have the Parent and the Tag elements if you have
s> the universal table already defined.

That's a might big if for most users. And as you know, the FOR XML EXPLICIT
really is working of its own/
s> You can tell that everyone knows this approach sucks. They say, "oh,
s> this is very powerful", which it is, compared to the crap called
s> AUTO. But, come on, a union per level? How gross is that?

Well, that's one opinion. It say it sucks because it is usable. Crap is unusable.
s> Please tell me that SQL Server 2005 does this in the most right and
s> obvious way.

Since I have no idea what your definition of right and obvious are, I'll
present what works in 2005 and allow you to draw your own inferences.
Show full article (1.62Kb)
no comments

RELATED THREADS
SubjectArticles qty Group
SQL Profiler in SQL Server 2000microsoft.public.sqlserver.programming ·