SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Is there a typo in the openxml part?


Is there a typo in the openxml part?

Author
Message
support-986502
support-986502
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
Points: 17 Visits: 24
Did you make a mistake in the openxml example?
I ask this because you have the following:

EXEC sp_xml_prepareDocument @hdoc OUTPUT, @Doc

So now I have to access the xml data using @hdoc right?
But you do it through @idoc in the following statement.

FROM Openxml (@iDoc,'//StockMarketData/StockData ')

You refer the reader to a Microsoft example which is:

EXEC sp_xml_preparedocument @idoc OUTPUT, @doc

OPENXML (@idoc, '/ROOT/Customer',1)

So it would seem that your openxml statement should be:

FROM Openxml (@hdoc,'//StockMarketData/StockData'@iDoc)

Am I correct or am I missing something because I do not understand how you can access the xml data using
@idoc which you initialize to a value of 1? Struggling a little with this.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search