我有一个名为服务条目的表。在一个服务条目中可能有多个部分。所以表服务入口部分的每个部分都会有一行。零件存储在零件表中。服务条目表有一个逗号分隔的列,其中包含用于在页面上显示的部件信息。
Dbo.Part
ID PartDescription
270 Syringe assembly
282 LPH pcb
287 Valve block assembly
Dbo.ServiceEntry
ServiceEntryID, Description
1200 270 ~ Syringe assembly ~ 7,3 ~ Increase drive current from 3 --> 1.|282 ~ LPH pcb ~ 8 ~ | 287 ~ Valve block
assembly ~ null ~
在上面这里是列的结构:
PartID ~ PartDescription ~ ServiceType ~ Comment
对于多个部分,添加此字符|
并重复结构。
ServiceEntryPart
:
ID ServiceEntryID PartID ServiceTypev Comment
1 1200 270 7,3 Increase drive current from 3
2 1200 282 8
3 1200 287 null
问题
Dbo.Part
ID PartDescription OldID
331 Syringe assembly 270
335 LPH pcb 282
336 Valve block assembly 287
因此,如果您查看上面的零件表,发生的事情是零件表正在更新。将添加新部件,对于现有部件,它们的 id 将更新为新 id,并且可能会有新的部件描述。如您所见,带有列部分描述的服务条目表将不会与之前创建的服务条目同步。我要做的是使用新的部件 ID 及其 dcescriptions 更新现有的服务条目部件表,最后更新服务条目表中称为部件描述的列。更新服务条目部分表很简单,但问题是如何更新服务条目表中的分隔列。