Re: DELETE statement - Progress




"Anahi Ludueña" <a_luduena@xxxxxxxxxxx> wrote in message
news:%231tLbpRMHHA.1872@xxxxxxxxxxxxxxxxxxxxxxx
Hi people,
I need to execute a DELETE statement (SQL Server), but as it takes some
time to finish, I would like to make a progress bar where I would show a %
of the task complete. I was checking the FetchProgress event of
ADODB.RecordSet, but I heard it is not fired when performing UPDATE or
DELETE. Is that right?
Is there another way to get a progress?
Thanks a lot,

The only way is to delete in chunks of 500-1000 rows at a time, e.g.,

DELETE [yourtable] WHERE IDENTITYCOL IN (SELECT TOP 500 IDENTITYCOL FROM
[yourtable] WHERE [criteria of original delete statement])

Execute that repeatedly until @@rowcount returns 0.


-Mark



Anahi



.



Relevant Pages

  • Re: function to approximate time elapsed
    ... I need a function to fill a progress bar about how much ... above increment statements should equal kTotalCount (although it's not ... If a particular prock takes longer to execute, say by a factor of 10 ... The finer the resolution, the more "linear" the bar's appearance will be, ...
    (sci.math)
  • Re: Displaying a Progress Indicator (VBA)
    ... Your code should execute almost instantly and therefore a progress bar ... Sometimes I come across lengthy macros and wonder if my computer "hung up" on ... Sub Macro1() ... How do I create a progress bar for this code. ...
    (microsoft.public.excel.misc)
  • DELETE statement - Progress
    ... I need to execute a DELETE statement (SQL Server), but as it takes some time ... I would like to make a progress bar where I would show a % of the ... Anahi ...
    (microsoft.public.data.ado)
  • Re: Using Thread.sleep(..) and Swing Components
    ... Peter Duniho wrote: ... Operations that take any significant amount of time should be handled on a different thread, using the EventQueue.invokeLaterand EventQueue.invokeAndWaitmethods to execute any code that is required to be executed on the EDT (such as setting the value of a progress bar control). ...
    (comp.lang.java.programmer)
  • RE: fetching data asynchronously using ado.net dataset
    ... DataReader Object and increment your progress bar one step with each record ... before hand so what you need to do it to create two queries for each query ... is the actual query you want to execute, then get its result in a reader ...
    (microsoft.public.dotnet.languages.csharp)

Loading