jadams0173
Technical User
- Feb 18, 2005
- 1,210
I have a one time task that I have to do on about 10000 records. I'm selecting from a SQL 2000 table the top 20 records. I'm doing this with a query from VB6. After I've printed labels for the top 20 I ask the user if they printed OK. If the user selects YES then I need to set the Printed column to 1. Execute a requery of the RS VB and process the next 20. If the user says no then i take no action and exit the sub.
My question is how can update the same 20 records that I just processed? I can write a loop from VB to do this if the user selects YES or I can do it one record at a time from VB as I print the label and then undo my changes if the user selects NO using a loop.
How could I do this from SQL. Can I pass in a RS. I tried UPDATE Top 20.... but that creates and error.
The task isn't that huge but it's more of a learing experience than anything to do it with sql. I thought about Batch updates but I'm not sure how to implement them or if they would work for me.
My question is how can update the same 20 records that I just processed? I can write a loop from VB to do this if the user selects YES or I can do it one record at a time from VB as I print the label and then undo my changes if the user selects NO using a loop.
How could I do this from SQL. Can I pass in a RS. I tried UPDATE Top 20.... but that creates and error.
The task isn't that huge but it's more of a learing experience than anything to do it with sql. I thought about Batch updates but I'm not sure how to implement them or if they would work for me.