简体   繁体   English

如何将记录从MDS转移到另一个表,然后从MDS删除某些记录而不从转移的表中删除它们

[英]how to transfer records from MDS to another table then delete certain records from MDS without deleting them from the transferred table

I'm using Master Data Service (Enterprise version for SQLServer2016) to collect data from different departments, so each group will have one or many attribute groups with update access. 我正在使用主数据服务 (SQLServer2016的企业版)从不同部门收集数据,因此每个组将具有一个或多个具有更新访问权限的属性组。 To indicate the cycle completion an attribute "Cycle Status" is set with value "Yes". 为了指示循环完成,将属性“循环状态”设置为值“是”。 Due to many business rule and multiple attributes groups the performance is getting very slow, so what I'm thinking of is: 1.transfering all records that have completed the cycle to a table then 2.delete those records from Master Data Service but this will not delete them from the Table(Point_1). 由于许多业务规则和多个属性组,性能变得非常慢,所以我想到的是:1.将完成周期的所有记录转移到表中,然后2.从主数据服务中删除这些记录,但这不会将它们从表(Point_1)中删除。 is there any clue how to do it?, I'm aware of having a subscription view in MDS but don't know if this can serve my case? 有什么线索吗?我知道在MDS中具有订阅视图,但不知道这样是否可以解决我的问题? and how? 如何?

E.IK, E.IK,

1st Approach: Conditional Evaluation of business rules 第一种方法:业务规则的条件评估

You can look at adding a Condition to all your Business Rules to only evaluate business rules 您可以查看将条件添加到所有业务规则中,以便仅评估业务规则

IF Cycle Status = "No" IF循环状态=“否”

This might reduce the performance impact you're seeing now (not sure). 这可能会降低您现在看到的性能影响(不确定)。 This can can be done by (in Edit Business Rule screen) 可以通过以下方法完成(在“编辑业务规则”屏幕中)

Conditions > Value Comparison > is equal to > Select attribute:="Cycle Status" > Attribute Value / Attribute := "No" 条件>值比较>等于>选择属性:=“循环状态”>属性值/属性:=“否”

This way you wouldn't have to move your data. 这样,您就不必移动数据。

2nd Approach: Move data to another (physical) table 第二种方法:将数据移动到另一个(物理)表

  • This approach would entail you to create a separate table (physical DB Table, Not Entity, so as to avoid MDS overheads) either in the same MDS DB or another DB. 这种方法将需要您在同一MDS数据库或另一个DB中创建一个单独的表(物理DB表,而非实体,以避免MDS开销)。
  • Then create an SP that will Insert rows with Cycle Status = "yes" to the 2nd table & mark them as Deleted in the MDS Entity. 然后创建一个SP,该SP将在第二个表中插入“循环状态”为“ yes”的行,并在MDS实体中将其标记为Deleted。
  • You may want to create an SQL Agent Job that can be scheduled to run this SP at whatever frequency you like (Daily, Weekly.. etc). 您可能想创建一个SQL Agent Job,可以安排它以您喜欢的任何频率(每天,每周等)运行此SP。
  • The challenges with this approach would be that your users will no longer be able to easily access this Archived data. 这种方法面临的挑战是您的用户将不再能够轻松访问此存档数据。

Another alternative approach... 另一种替代方法

would be to create a separate MDS Model - "Archive". 将是创建一个单独的MDS模型-“存档”。 Create a similar entity there (like a mirror) & rather than moving Closed records to a Db Table, add them to the mirror entity in the Archive model. 在此处创建类似的实体(例如镜像),而不是将Closed记录移动到Db Table,将它们添加到Archive模型中的镜像实体。 You may want to give all users only Read-Only access to this new entity. 您可能希望仅授予所有用户对此新实体的只读访问权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM