How to Truncate a table? | Adobe Higher Education
Skip to main content
Level 2
August 11, 2020
Resuelto

How to Truncate a table?

  • August 11, 2020
  • 1 respuesta
  • 5468 visualizaciones

Hi everyone

 

I am trying to truncate the contents of a custom table in the Adobe Campaign database. I created that table to hold a set of data that is imported on a daily basis from an external file,but I need to truncate it before loading the data set.

 

I know I could use the Update activity to delete records, but that requires an input. I could build that input by querying all data in the target table first and pass it to the Update activity, then the Update activity would delete the records from the incoming population. However, it would be much more efficient to just truncate the full table.

 

Can someone provide guidance on how to do it?

 

Cheers

Hugo

Este tema ha sido cerrado para respuestas.
Mejor respuesta de Milan_Vucetic

Hi @hugol_vallejo

To truncate the table please use SQL Code activity under Actions tab and use command:

TRUNCATE TABLE <tableName>

Regards,

Milan

1 respuesta

Milan_Vucetic
Milan_VuceticRespuesta
Level 9
August 11, 2020

Hi @hugol_vallejo

To truncate the table please use SQL Code activity under Actions tab and use command:

TRUNCATE TABLE <tableName>

Regards,

Milan

Level 2
August 11, 2020

Thanks Milan

Never had used the SQL activity, so that was an easy one. Thanks for the quick reply