Re: Retrieving Huge Data From DB in steps of 1000

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Eric.Li (anonymous_at_microsoftnews.org)
Date: 06/02/04

  • Next message: T.K. Anand [MSFT]: "Re: How to pass additional dimensions to Mining Model using VB6"
    Date: Wed, 02 Jun 2004 14:19:54 -0500
    
    

    Well depends on if you have unique key or not

    Let's say you don't

    then create a temp. table with identity column with seed (1, 1) or (0,
    1), then select everything from your main table into this temp. table

    if you want to process only 1000 records, then open a cursor on the
    first 1000 records, process them, delete them from the temp. table,
    repeat this process till you are done.

    -- 
    Eric Li
    SQL DBA
    MCDBA
    SSP wrote:
    > Hello,
    > I am working on a application that involves processing 
    > 60,000+ rows of records from one table alone. This table's 
    > child tables have probalby double the number of records 
    > than that are present in the parent.My question is how can 
    > I retreive records in say steps of 1000 process them , 
    > then go to the next 100o records in the same table, 
    > process them and so on.
    > Ideally I would prefer it done on the SQL Level, through 
    > Stored Procedures, Cursors,etc. But I am not sure how to 
    > do it. So would someone plz help me with a example on how 
    > to do this or a much a better  aprroach if present would 
    > be very highly appreciated.
    > Thanx,
    > SSP.
    > .
    > 
    > 
    

  • Next message: T.K. Anand [MSFT]: "Re: How to pass additional dimensions to Mining Model using VB6"

    Relevant Pages

    • Re: Totals Query hard to figure out
      ... Add a unique key to tblFits and this problem ... one option is to clear a temp table ... your "pre-aggregated" tblFit records to the ... then change to make table query, ...
      (microsoft.public.access.queries)
    • Re: Insert multiple non-existing records
      ... that unique key. ... This option prevents duplicate keys from being inserted ... Create a temp table containing the values in the XML document> 2. ... Do a SELECT INTO and create a LEFT JOIN with the temp table and the main> table so that only the records that aren't in the main table at the moment> are included in the insert. ...
      (microsoft.public.sqlserver.programming)
    • Re: Moving Source record to a TEMP file
      ... unique key to do so. ... table to move this record to a temp table. ... John W. Vinson [MVP] ...
      (microsoft.public.access.forms)