MERGE INTO [credit].[record_rule_data] AS a
USING @tem AS b ON a.user_gid =@userLogGid AND a.rule_id =b.ruleName
WHEN MATCHED AND a.user_gid =@userLogGid THEN UPDATE SET a.rule_value =b.ruleValue ,create_time=@cur,a.data_version=@dataVer
WHEN NOT MATCHED BY TARGET THEN
INSERT
(gid, create_time, data_version, user_gid, rule_id, rule_value)
VALUES
(b.gid,@cur,@dataVer,@userLogGid,b.ruleName,b.ruleValue)