cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional delete from a databases using a value from the pipeline

maahutch
New Contributor

I'm trying to delete rows from my database when their id's aren't in the response document returned from an api query. Currently, my pipeline looks like this:

maahutch_0-1698792111524.png

If there is an ID value in the SQL Server table that is not in the REST response document, I want to delete that row from the table. Here's my current non-working SQL Query:

maahutch_1-1698792295965.png

But this doesn't work; it doesn't delete anything from the target table. How can I delete rows form the table when they aren't present in the api response?

 

 

 

 

 

1 REPLY 1

SpiroTaleski
Valued Contributor

@maahutch 

On Validation mode, the pipeline is working only with subset of records(1 to 2000 records), depending what you have selected in the User settings. 

Spiro_Taleski_0-1698828250826.png

So, probably that subset of records does not meet the condition in the delete statement. 

Try to execute the pipeline. And also check the Snap Execution Mode of the SQL Server Execute Snap. 

BR,

Spiro Taleski