首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

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

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

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 

热点排行