日期:2014-05-17  浏览次数:20399 次

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

求大虾们解决

------解决方案--------------------
SQL code
update [WebSales] SET W.Price = t.Price,W.SaleDate = t.SaleDate,W.CustomerID = t.CustomerID 
FROM [WebSales] W
inner join
(
  SELECT   
  ProductID,  
  Price,  
  SaleDate,  
  SaleBatchID,  
  CustomerID  
  FROM   
  OPENXML (@Pointer, '/ShoppingCart/Purchase ')   
  WITH   
  (   
  ProductID INT,   
  Price MONEY,   
  SaleDate SMALLDATETIME,   
  SaleBatchID INT,   
  CustomerID INT   
  )
) t
on W.ProductID=t.ProductID