比较Teradata中两个表的内容的最佳方法? [英] Best way to compare contents of two tables in Teradata?

查看:294
本文介绍了比较Teradata中两个表的内容的最佳方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您需要比较两个表以了解差异时,是否使用了任何工具或快捷方式,还是手动编写了SQL来比较两个表?

When you need to compare two tables to see what the differences are, are there any tools or shortcuts you use, or do you handcode the SQL to compare the two tables?

基本上,诸如Red Gate SQL数据比较之类的产品的核心功能(我的表的方案通常总是匹配的.)

Basically the core features of a product like Red Gate SQL Data Compare (schemas for my tables typically always match).

背景:在我的SQL Server环境中,我创建了一个存储过程,该过程检查两个表/视图的元数据,创建一个查询(作为动态sql),该查询将指定键列上的两个表连接在一起,并比较其中的数据.比较列,报告关键差异和数据差异.该查询既可以打印和修改/复制,也可以按原样执行.不幸的是,我们不允许在Teradata环境中创建存储过程.

Background: In my SQL Server environment, I created a stored procedure which inspects the metadata of the two tables/views, creates a query (as dynamic sql) which joins the two tables on the specified key columns, and compares data in the compare columns, reporting key differences and data differences. The query can either be printed and modified/copied or just excecuted as is. We are not allowed to create stored procedures in our Teradata environment, unfortunately.

推荐答案

听起来像数据分析工具,例如

Sounds like a data profiling tool such as Talend's Open Profiler would make the most sense at that point.

您可以编写一个BTEQ语句来构建类似于SQL Server存储过程的查询,然后导出动态构建的SQL.然后,您可以在BTEQ内部运行它.它可能会很麻烦,但是只要有足够的决心,您就可以模拟出一些东西.

You could write a BTEQ statement that builds the query similar to your SQL Server stored procedure and then export the dynamically built SQL. You can then in turn run that inside of your BTEQ. It might get cumbersome, but with enough determination you could probably mock something up.

这篇关于比较Teradata中两个表的内容的最佳方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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