读书人

xml作参数 通过存储过程来更新表中的数

发布时间: 2012-09-10 22:20:13 作者: rapoo

xml做参数 通过存储过程来更新表中的数据
你好,我在网上找了一个xml做参数 存储过程插入数据的,实现了,
能否根据xml参数更新表里已有的数据

求大虾们解决

[解决办法]

SQL code
update [WebSales] SET W.Price = t.Price,W.SaleDate = t.SaleDate,W.CustomerID = t.CustomerID FROM [WebSales] Winner join(  SELECT     ProductID,    Price,    SaleDate,    SaleBatchID,    CustomerID    FROM     OPENXML (@Pointer, '/ShoppingCart/Purchase ')     WITH     (     ProductID INT,     Price MONEY,     SaleDate SMALLDATETIME,     SaleBatchID INT,     CustomerID INT     )) ton W.ProductID=t.ProductID 

读书人网 >SQL Server

热点推荐