从表格加载到历史记录和电子邮件通知

编程入门 行业动态 更新时间:2024-10-23 05:38:58
本文介绍了从表格加载到历史记录和电子邮件通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

您好

我每天都会收到源文件并加载到表中。此表中的数据将包含5个不同的字段,其中2个字段为日期列。

I get source files and load in to a table on a daily basis. the data on this table would have 5 different fields with 2 fields as date columns .

唯一列为date1和Col2。当我看到每个月的最后一个工作日时,我需要抓住这些记录并填入历史记录表。

The unique column would be date1 and Col2. When ever i see the last business day of month i need to grab those records and populate in to history table.

此源表上可能有更新,需要保留历史记录历史表下的数据,并向客户发送新旧价值的电子邮件。

There can be updates on this source table and need to maintain history of data under historical table and send out email to customers the old and new value.

我可以使用缓慢变化的维度并使用start和end_dt存储历史属性,其中end_dt将在更新时更新价值变化。

i can use slowly changing dimension and store the historical attribute with start and end_dt where end_dt would be updated when there is a change in value.

问题,如何获取旧值和新值并发送电子邮件通知

Question, How can i grab the old and new value and send email notifications

谢谢

Thanks

raj

推荐答案

Hi Raj,

Hi Raj,

这个场景可以通过多种方式解决,典型的方法是:

This scenario can be solved in many ways, the typical ones:

1)使用T-SQL使用OUTPUT子句合并命令(首选)。取决于SQL Server版本(命令可用性)

1) Use T-SQL Merge command with the OUTPUT clause (preferred). Depends on SQL Server version (command availability)

2)更改捕获 - SQL Server的一项功能

2) Change Capture - a feature of SQL Server

3 )使用触发器(在插入,更新时)

3) Use triggers (On Insert, Update)

4)使用一个临时表,即所谓的临时表,您将任何记录放在第一个然后处理。

4) Use an interim table, the so called staging table to which you put any records 1st and then process.

它基本上取决于其他方面,技术而不是你的编程能力,数据量和处理过的所需速度与机器容量和功能相比。

It basically depends on other things, technical and not as your ability to program, amount of data and speed of the processed desired compared to machine capacity and capabilities.

更多推荐

从表格加载到历史记录和电子邮件通知

本文发布于:2023-10-28 01:04:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1535041.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:历史记录   表格   加载   电子邮件   通知

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!