Alteryx Designer

Find answers, ask questions, and share expertise about Alteryx Designer.

Alteryx - SQL - Re-Writing Files

7 - Meteor

Hi everyone!

Hope you're all doing well.


I am currently using a workflow in which I am getting a directory of Excel files then checking if a file has been processed before by comparing it with the database using in-Database tools then processing the files that were not processed before 1 by 1 in a macro and uploading them to the Database appended to each other with a unique column that has the file name. 


However, I realized that sometimes I will need to re-process files, thus, I will need to delete the data for the re-processed file from the Database first then doing the processing again. The way I am approaching it now, Is I am getting all the data in the database, deleting the rows that contain data from the files that I want to re-process tthen using the delete & append option.


Would there be a better option, whereas I could just delete the specific rows that contain the file name from the database?


Please let me know if you need more information.


Thanks a lot!

Alteryx Certified Partner

Hi @Faresghnaim ,


assuming you have a way of identifying automatically those records you need to delete, you could use the output tool with an odbc connection to your database. On the output tool use the Pre Create SQL Statement:



This will allow you to drop those records before you output the new records.


Hope this helps.



7 - Meteor

Thank you so much @mceleavey , the thing is, I want to delete the rows based on different file numbers, but the where clause in the SQL statement cannot be a column. This is why I am using the normal Alteryx tools to delete all the rows with the filenames using a filter then deleting & appending.