> I am absolute a novice in XML but need to shred XML into SQL Server
> 2005.
> I studied some examples, but only with simple XML Docs.
> My docs seems to be looking more complex.
>
> Maybe someone can point me into the right direction:
Since I don't know what you what you want to get out of the document,
I can't give you any code.
In general, there are two methods: OPENXML and XQuery. OPENXML is
the older method, introduced in SQL 2000, XQuery was added in SQL 2005.
XQuery is a standardised language to query XML documents, not only
in SQL Server.
OPENXML may be easier to get started with, but I since XQuery is newer,
I think it's better in the long run. Then again, I have seen situations
where the performance XQuery have been outright poor with element-
centred XML which is what you have.
Both OPENXML and XQuery are described in Books Online, and you could
start reading, but of course if you are completely new to XML, the
learning curve may be a bit steep.
Unfortunately, I cannot really give good recommendations on books. I
learnt XML myself from "XML Step by Step" by Michael Yuong and
"Programming Microsoft SQL Server 2000 with XML" by Graeme Malcolm.
The latter book is definitely dated by now, unless the author has an
update for SQL 2005. The former book is a little more timeless, and
is good enough to learn you what XML is, but it will not teach you
XQuery. Unless, again, there is a newer edition; my copy is several
years old.

Signature
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Theo Müller - 28 Dec 2007 14:02 GMT
> > I am absolute a novice inXMLbut need toshredXMLintoSQLServer
> > 2005.
[quoted text clipped - 5 lines]
> Since I don't know what you what you want to get out of the document,
> I can't give you any code.
thanks for your reply.
quite easy speaking, i want to 'import' the xml to tables. But because
of the structure of the xml, i don't know how to do.
THere is a different sample in this group, with a 'easy' xml doc. i
understandn how to do it with that one....
so maybe its a bit more clear now.
BR
Erland Sommarskog - 28 Dec 2007 22:32 GMT
> thanks for your reply.
> quite easy speaking, i want to 'import' the xml to tables. But because
> of the structure of the xml, i don't know how to do.
And I don't know the tables, nor which elements you want there, so I
don't know either.

Signature
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx