Select only nn records

  • Thread starter Thread starter Edwin Knoppert
  • Start date Start date
E

Edwin Knoppert

We have end-users doing a selection, the selection is copied into another
table (claimed) (we do this for them in a batch during the night)
To limit the endusers account balance we promote for example a max. of 500
records per month.
Currently i do a batch which claims all based on specific criteria, this is
fine but still want to limit the nr of records to a certian max.

This is an INSERT INTO (select from... ) situation.

Time is not really relevant but i still would like an efficient way and thus
not record by record copy until max is reached.

Then again, each day the batch claims let's say ~50 records, so after ~10
days no more records would be required when the max is set to 500.
At the other hand, it is possible during one batch the limit is reached in
one pass.
So that count is unpredictable.

Can i do this with SQL?
We use an Access MDB and the batch is executed by Windows and executes an
URL (via a little extra win32 app).
The URL is an ASP.NET 2 website.
 
Back
Top