I want to pass xml document to sql server stored procedure such as this:
CREATE PROCEDURE BookDetails_Insert (@xml xml)
I want compare some
For part 2 of your question, see my answer to Stored procedure: pass XML as an argument and INSERT (key/value pairs) for an example of how to use XML within a stored procedure.
EDIT: Sample code below is based on the specific example given in the comments.
declare @MyXML xml
set @MyXML = '
700001048
01048B
http://www.landt.com/Books/large/00/70100048.jpg
QUICK AND FLUPKE
PRANKS AND JOKES QUICK AND FLUPKE - CATASTROPHE QUICK AND FLUPKE
'
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)