Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How to Truncate a table?

Avatar

Avatar
Validate 1
Level 1
hugol_vallejo
Level 1

Likes

3 likes

Total Posts

13 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
hugol_vallejo
Level 1

Likes

3 likes

Total Posts

13 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
hugol_vallejo
Level 1

10-08-2020

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Contributor
MVP
Milan_Vucetic
MVP

Likes

166 likes

Total Posts

383 posts

Correct Reply

135 solutions
Top badges earned
Contributor
Springboard
Shape 1
Validate 25
Validate 10
View profile

Avatar
Contributor
MVP
Milan_Vucetic
MVP

Likes

166 likes

Total Posts

383 posts

Correct Reply

135 solutions
Top badges earned
Contributor
Springboard
Shape 1
Validate 25
Validate 10
View profile
Milan_Vucetic
MVP

11-08-2020

Hi @hugol_vallejo

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

TRUNCATE TABLE <tableName>

Regards,

Milan

Answers (0)