标签:
merge TableName as target using( values(‘FIELDVALUE1‘,‘FIELDVALUE2‘)) as source (FIELDNAME1,FIELDNAME2) on target.FIELDNAME1= source.FIELDNAME1 when matched then update set FIELDNAME2= source.FIELDNAME2 when not matched then insert (FIELDNAME1,FIELDNAME2) values (source.FIELDNAME1,source.FIELDNAME2);
这是用SqlServer 的MERGE来实现AddOrUpdate功能的
SqlServer Merge AddOrUpdate data
标签:
原文地址:http://www.cnblogs.com/Excelsior/p/5366480.html