This seems like a bad use of a stored procedure. Why wouldn't you spin up 40 clients with a table name and run it across 40 connections? But also, I don't like loops in stored procedures. Working with loops in a set based system hurts me but it's personal preference.
Like, I could write this in python in less than 4 hours with an extremely simple sproc. How often are you running table deletions like this to require a sproc?
Thanks,
Ben
On Wed, Oct 19, 2022, 5:39 PM Thomas Kellerer <shammat@gmx.net> wrote: