UPSERT帮助 [英] UPSERT Help
问题描述
在我的日常加载中是否有一个很好的链接或文档来进行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
这篇关于UPSERT帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!