Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 To update multiple records using SP_XML_PREPAREDOCUMENT

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-08-06 : 08:49:38
Deepa writes "Hi,
I would like to post the following question.
The scenario is that i should update more than one record in a single table using a stored procedure to which i will send a xml string , say ,
'<abc> <tabname field1="value1" field2="value2"..../>
<tabname field12="value12" field12="value12"..../>
<tabname field13="value13" field12="value13"..../>...
</abc>'..

How can this be achieved using SP_XML_PREPAREDOCUMENT??Am Using MS SQL server 2000 and Windows 2000.

Thanks in advance!!"

jasper_smith
SQL Server MVP &amp; SQLTeam MVY

846 Posts

Posted - 2002-08-06 : 11:18:47
Just use it the same as you would any table

update t1
set t1.col2=t2.col2
from mysqltable t1
join
(select col,col2 from OPENXML(.....)) t2
on t1.col1=t2.col1



HTH
Jasper Smith
Go to Top of Page
   

- Advertisement -