Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

XML document referenced as an idoc?

 
   Database Help (Home) -> XML RSS
Next:  XML document referenced as an idoc  
Author Message
Dixie Normous

External


Since: Dec 31, 2008
Posts: 3



(Msg. 1) Posted: Wed Dec 31, 2008 2:01 pm
Post subject: XML document referenced as an idoc?
Archived from groups: microsoft>public>sqlserver>xml (more info?)

I have a stored procedure which passes a reference to an XML document
(SQL 2000 style) using an int variable @idoc to another proc.

The receiving proc extracts the elements to grab the appropriate
fields values. The document looks like this:

<Account>
<AccountInfo AccountDestination="Alpha AccountSource="myDatabase"
AccountStatus="Active" />
</Account>


Currently, the proc uses this select to grab the data.

SELECT @AccountDestination = AccountDestination,
@AccountSource = AccountSource,
@AccountStatus = AccountStatus
FROM OPENXML(@idoc, '/Account/AccountInfo', 1) WITH (
@AccountDestination varchar(30),
@AccountSource varchar(50),
@AccountStatus varchar(30)
)


The XML document will be changing though such that a new element
(NewElement) is added along with some child nodes
(NewElementChildNode).

<Account>
<AccountInfo AccountDestination="Alpha AccountSource="myDatabase"
AccountStatus="Active" />

<NewElement>
<NewElementChildNode Name="testName" Address="testAddress" /
>
<NewElementChildNode Name="anotherTestName"
Address="anotherTestAddress" />
</NewElement>

</Account>


Now, there will be the NewElement, under which I need to be able to
grab the data from each NewElementChildNode.

How can I do this using a similar SELECT with OPENXML? Do I need to
cursor through however many NewElementChildNode elements and process
each child node individually? Again I'm stuck with SQL 2000
conventions here so I'm not able to use the new XML data type provided
in 2005, for example.

Thanks in advance for suggestions.

 >> Stay informed about: XML document referenced as an idoc? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
how to store a word document in sql server - I Need help on how to store a word document in sql server.what datatype and how to convert it to store it. Pleas Help Thank you

How to import word document to sql server? - How can I import my word documents into SQL server 2000?

Use named ROOT for import XML document - I want to import an XML document by SQLXML BulkLoad with the root element not named <ROOT> ... </ROOT>, but having a specified meaningful name. What do I write in the related XSD schema in order to does SQLXML BulkLoad function correctly? T...

Is there any way to give xquery in sql server a hint as to.. - Is there any way to give xquery in sql server a hint as to how large the resulting document will be so that it preallocates more efficiently?

xml to SQL DB - We have some large existing Xml files that we'd like to store in the SQL server. We don't want to store just the Xml stream, but we rather like to build the hierarchical structure that represents the Xml in SQL and store the Xml that way. We also want...
   Database Help (Home) -> XML All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]