SQL Server Performance

Firehose cursor and filling arrays

Discussion in 'Non-Transact SQL Developer Performance Tuning' started by TheGios, Nov 29, 2004.

  1. TheGios New Member

    I know that for best performance should use a firehose cursor if only retrieving data (to fill in a list box, for example).
    The prblem i have is that I have to fill in an array and of course i don't know the number of records i will fetch with my query. Using a firehose cursor (being it server side) I cannot use the RecordCount property of the recordset object, so I cannot dimension the array I have to fill. using a Redim for each iteration is a bad idea, of course?

    Any solution?

    The only one i can think of is to dimension the array to a very big dimension (like 1000, I know i have less than 1000 records) and use a counter to count the iterations to fill in the array, and then redim it to the correct size.
  2. Argyle New Member

Share This Page