static int DoDeletes(List <string> CorpIdList) { StringBuilder sb = new StringBuilder(); int delCount = 0; int li = -1; while (li + 1 < CorpIdList.Count) { sb.Length = 0; int sbCorpIdCnt = 0; for (li = li + 1; li < CorpIdList.Count; li++) { if (sb.Length > 0) { sb.Append(","); } sb.Append(CorpIdList[li]); sbCorpIdCnt++; if (sbCorpIdCnt >= 1000) { break; } } string sql = "delete from mbs_owner.corp_moltable_mx " + "where corp_nbr in (" + sb + ")"; int delCount2 = DbCommandMx.PrepareAndExecuteNonReaderSql(sql); delCount += delCount2; } return(delCount); }