>Hi Sergey, I'm all ears if you want to tell me how to avoid using a cursor, what the SP in question does is, inserts records into several tables used as audit trails for a given customer ref, populates fields clearing flags etc... on a per customer basis, at present the SP is used by an app which only passes it one reference to work with , I just thought as the SP is well proven I could use it in a batch operation
It seems like cursor is appropriate option in this case unless stored procedure can be easily modified to handle one or multiple custiomers based on parameters passed.
See DECLARE CURSOR in BOL for sample code.
--sb--