For del 2 af dit spørgsmål, se mit svar til Stored procedure:send XML som et argument og INSERT (nøgle/værdi-par) for et eksempel på hvordan man bruger XML i en lagret procedure.
REDIGER :Eksempelkoden nedenfor er baseret på det specifikke eksempel givet i kommentarerne.
declare @MyXML xml
set @MyXML = '<booksdetail>
<isbn_13>700001048</isbn_13>
<isbn_10>01048B</isbn_10>
<Image_URL>http://www.landt.com/Books/large/00/70100048.jpg</Image_URL>
<title>QUICK AND FLUPKE</title>
<Description> PRANKS AND JOKES QUICK AND FLUPKE - CATASTROPHE QUICK AND FLUPKE </Description>
</booksdetail>'
select Book.detail.value('(isbn_13/text())[1]','varchar(100)') as isbn_13,
Book.detail.value('(isbn_10/text())[1]','varchar(100)') as isbn_10,
Book.detail.value('(Image_URL/text())[1]','varchar(100)') as Image_URL,
Book.detail.value('(title/text())[1]','varchar(100)') as title,
Book.detail.value('(Description/text())[1]','varchar(100)') as Description
from @MyXML.nodes('/booksdetail') as Book(detail)