码迷,mamicode.com
首页 > 其他好文 > 详细

Delete Exists

时间:2015-05-22 11:00:39      阅读:116      评论:0      收藏:0      [点我收藏+]

标签:

Create PROCEDURE [dbo].[LVS_Update_WaferInfo]
@LotId varchar(40),
@xmlData xml
as
BEGIN

delete W from LVS_WaferList W,
(
select distinct @LotId LotID,T.C.value (‘CURRENTPASS[1]‘ , ‘varchar(max)‘ ) as CurrentPass
from @xmlData.nodes (‘//dt_result‘ ) as T(C)
) M
where M.LotID = W.LotID and M.CurrentPass = W.CurrentPass


insert into LVS_WaferList (LotID,CurrentPass,RingID,WaferFile,WaferLimit,ActionDate)
select distinct @LotId LotID,T.C.value (‘CURRENTPASS[1]‘ , ‘varchar(max)‘ ) as CurrentPass,
T.C.value (‘RINGID[1]‘ , ‘varchar(max)‘ ) as RingID,
T.C.value (‘INVENTORISEDWAFERID[1]‘ , ‘varchar(max)‘ ) as WaferFile,
T.C.value (‘QUANTITY[1]‘ , ‘int‘ ) as Qty,GETDATE()
from @xmlData.nodes (‘//dt_result‘ ) as T(C)

END

Delete Exists

标签:

原文地址:http://www.cnblogs.com/wonder315/p/4521469.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!