|
Posted by figital on 07/12/06 19:29
If you actually have things running so that you drop a command off at
the database and don't have to wait for it (but it will complete on its
own), then all you really need is a status table or queue table.
With this route, you could drop a "task" into a table with fields
indicating its status. Then your front end would check the status in
the table periodically. Using some of Erland's suggestions, you could
even incorporate progress information if any existed (e.g. 3/10 steps
complete).
I would tend to agree with others though in that wildly inaccurate
status information is worse than not knowing.
Take airline sites for an example. You key in your travel info, then
you see a spinning wheel for anywhere from 3 seconds to over a minute.
You have no idea how long it will take but from experience, you know
what is "reasonable". I think it'd be aggrevating if they would give
you a percentage that represented progress in terms of anything other
than time (what if that last 2% takes 90% of the total time?).
Michael
Zvonko wrote:
> So, one more thing.
>
> Let's say that a user clicks a button that executes a stored procedure
> which computes some figures: how will my application know when the procedure
> is done, so it can get a result on screen.
> How to achieve that?
>
> Zvonko Biskup
>
>
>
> "Erland Sommarskog" <esquel@sommarskog.se> wrote in message
> news:Xns97FC86C30C3CEYazorman@127.0.0.1...
> > What we do? Write so fast code, that there is no need for progress bars!
> > :-)
> >
> > The root problem is that SQL Server does not give any progress
> > information.
> > And that might be just as well. Recall that the optimizer builds the query
> > plan from statistics sampled about the data. From this it makes an
> > estimate
> > of what is the best plan. Any progress information would be based on this
> > estimate. And if the estimate is wrong - which is not unusual - the
> > progress
> > information would be too. I can't speak for anyone else, but personally
> > I find incorrect progress information to be worse than no progress
> > information at all.
> .com/sql/prodinfo/previousversions/books.mspx
[Back to original message]
|