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.
It runs as a Pre Step before data cleansing on the custom table.
Every time you execute this the line amount doubles.
There are three methods to fix this.
- You add a truncate [dbo].[tablename_R] as the first line of the script.
- You add a check on the table for truncation of the r table after the data cleansing.
- 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.
The benefits of using method 3 is that you now know exactly what the script does and what table it affects.