UPSERT帮助 [英] UPSERT Help

查看:69
本文介绍了UPSERT帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的日常加载中是否有一个很好的链接或文档来进行upsert。目前我正在做TRUNCATE / INSERT但现在我想跟踪变化的记录并在我的表中维护旧的记录。请分享一些文件。



谢谢

解决方案

你可以有多种方法


1。使用查找


2使用合并连接


3。通过使用登台表,然后在T-SQL中执行UPSERT逻辑


1和2看起来像这样


http://www.sqlis.com/sqlis/post/Get-all -from-Table-A-that-in-Table-B.aspx


两个输出用于获取新的和修改过的行。


Is there a nice link or documentation for doing upsert in my daily load. Currently i am doing TRUNCATE /INSERT but now i want to track the changing records and maintain the older ones as well in my table. Please share some documentation.

Thanks

解决方案

you can have multiple approaches

1. using lookup

2 using merge join

3. by using staging table and then do UPSERT logic in T-SQL

1 and 2 looks like this

http://www.sqlis.com/sqlis/post/Get-all-from-Table-A-that-isnt-in-Table-B.aspx

with both outputs utilized to get new and modified rows.


这篇关于UPSERT帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆