Truncating a foreignkey? Consequences | Community
Skip to main content
Level 6
June 10, 2024
Solved

Truncating a foreignkey? Consequences

  • June 10, 2024
  • 1 reply
  • 6818 views

Hi, I've created a 1-to-1 relationship between table ABC and Recipients.

This question is related to this one.  

Now, We need to empty the table ABC every day, to ingest new data only. This is done using a SQL activity and doing a truncate on the table, so we only keep the headers.

Beign the relationship a foreign key with recipients, how would doing a truncate action on table ABC affect recipients?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by LakshmiPravallika

Hi @god_prophet ,

 

In the given links , the attribute revIntegrity="normal" is defined, so it will initialize all the Foreign Keys if the deletion happened at the source Schema. 

 

So the truncate operation on ABC would only initialize the foreign keys of Recipient Schema.

 

PFA the documentation for reference,

 

https://experienceleague.adobe.com/en/docs/campaign-classic/using/configuring-campaign-classic/schema-reference/elements-attributes/element

 

Regards,

Pravallika.

1 reply

LakshmiPravallika
Community Advisor
LakshmiPravallikaCommunity AdvisorAccepted solution
Community Advisor
June 10, 2024

Hi @god_prophet ,

 

In the given links , the attribute revIntegrity="normal" is defined, so it will initialize all the Foreign Keys if the deletion happened at the source Schema. 

 

So the truncate operation on ABC would only initialize the foreign keys of Recipient Schema.

 

PFA the documentation for reference,

 

https://experienceleague.adobe.com/en/docs/campaign-classic/using/configuring-campaign-classic/schema-reference/elements-attributes/element

 

Regards,

Pravallika.

Level 6
June 11, 2024

Hi @lakshmipravallika , 

 

Could you detail this part: "So the truncate operation on ABC would only initialize the foreign keys of Recipient Schema".

What is: only initialize? So records on Recipients won't be deleted?

I need only to delete (truncate) records on ABC.

Level 6
June 11, 2024

So according to me research, those foreign keys in the Recipients schema are set to null, so there are no orphan foreign keys.

 

No records are deleted in Recipients, due to  the attribute revIntegrity="normal".

Thank you, Pravallika.