从XML更新 [英] Updating from a XML
本文介绍了从XML更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
下面的事情可能吗?
我有一个长的XML字符串,可以从中选择数据.此数据是表的更新的行,可以执行以下操作:
Is the below thing possible?
I have a long XML string from which I select data. This data is the updated rows for a table, would it be possible to do something like this:
EXEC sp_xml_preparedocument @Handle OUTPUT, @Tags
UPDATE
Pharmacy.Bins
SET
FROM
(SELECT
Notes
FROM
OPENXML(@Handle,'/data/Bins',2)
WITH (BinID int, ClosetID int, Notes nvarchar(MAX))
) AS O
JOIN Pharmacy.Bins AS B
ON O.BinID = B.BinID
)
推荐答案
很难在这里查看并判断是否可行.请在此处查看在SQL中使用XML的详细信息:
MSDN:Microsoft SQL Server 2005中的XML支持 [
It is difficult to look here and tell if it''s possible or not. Please have a look at the details of using XML in SQL here:
MSDN: XML Support in Microsoft SQL Server 2005[^]
You should get an idea of what things are possible.
这篇关于从XML更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文