Alteryx Designer Desktop Discussions

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

delete previous records based on criteria before saving data into database through alteryx

Bunty
5 - Atom

Hi,

 

I want to delete the previous records when saving data in sql database table through odbc connection on the server

we use alteryx output tool. the reason behind that multiple users run the workflow from gallery. there could be  case where same data will get uploaded in the database. so, i want to restrict the duplicate data to get saved in the databse.

I can see 'Pre Create SQL Statement' option in output tool.

Does anyone knows how to deal with this so that no duplicate data gets saved/uploaded in the database.

 

Exp - I have Reporting date as '2022-02-01' and i running the workflow from gallery. data will get saved in the database

but if any other person runs the same workflow which has reporrting date as '2022-02-01'. it should not be saved else already existing data should be deleted first and then new data should get appended in the database.

 

 

Thanks

 

1 REPLY 1
atcodedog05
22 - Nova
22 - Nova

Hi @Bunty 

 

If your table has a primary key you can use Update: Insert if New this way it only updates the row if it already exists.

 

Hope this helps : )

Labels