I have a script written in python which I am hoping to use as part of Comp Search Routine in one of our ArcGIS Server based Websites. Basically given a set of variables, the code constructs a sql statement that should return a set of ParcelIDs. When I run the code in idle it works fine. When I set it up as a script with parameters in ArcCatalog (10.31) , the script runs successfully the first time, but crashes ArcCatalog on the second try. I've isolated it to when it tries to the "execute" command the second time. I am wondering if anyone has experience similar crashing behavior and whether I need to do more clean up of the code before the script ends?