I am trying to build a script that will delete a fixed number of records at a time, such as 10,000, from a table based on the primary key. The table name is Trans and the primary key column name is ID. In a separate table named TransIDsToDelete, I have one column named TransID which contains the IDs of the records I would like to delete from the Trans table. The TransIDs are listed from lowest to highest. Most of the TransIDs in the TransIDsToDelete table increment by 1, but occasionally there may be a very sudden increase in the value for the TransID. For example the value for TransID may be 1500 for the 100th row, but the value for row 101 is 23989. I would also like to specify the total number of records I'd like to delete, and have the script iterate through until that number is reached, and then terminate. Can someone provide me with an example that deletes the records from the Trans table in batches of say 10000?