摘要: 使用 merge 对数据进行 插入或 修改的操作CREATE procedure InsertUnitMeasure @a nvarchar(100),@b nvarchar(100)as begin set nocount on merge temp as target --数据目标源 temp是表 using (select @a,@b) as source (a,b) -- 数据源 on (target.a=source.a) --比较的字段 when matched then update set b=source.b --如果符合 就更新 b字段 when not matched t 阅读全文
posted @ 2011-06-23 13:45 Shikyoh 阅读(910) 评论(1) 推荐(0) 编辑