Follow

How to avoid doubles in a custom table

If you have a script that is used to fill a custom table, you may get doubles, if you do nothing about it.

The reason it doesn't get truncated, is that there is no data transfer on a custom table.

The setup for doubles

You have a custom script. It uses a Insert Into command to fill a table.

1.PNG

It runs as a Pre Step before data cleansing on the custom table.

2.PNG

Every time you execute this the line amount doubles.

The solutions

There are three methods to fix this.

  1. You add a truncate [dbo].[tablename_R] as the first line of the script.
  2. You add a check on the table for truncation of the r table after the data cleansing.
    4.PNG
  3. Instead of using a custom script and then calling it as a Pre Step. You use the Custom Table Insert feature. Guide here. You use the same script as before, but remove the insert into statement. This truncates the table.
    3.PNG

The benefits of using method 3 is that you now know exactly what script.

 

 

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.