We are converting a stored procedure from Sybase to Teradata that contains 20+ while loops and uses global temporary tables. We have found performance to vary dramatically based upon system activity even after allocating to a separate resource partition with a "rush" priority. Are there best practices for converting while loops? Would it be better to convert the looping logic into a bteq script? or individual stored procedure calls?