Re: Records lost in an ADOStoredProc
From: J West (jimw_at_fluffypaws.co.uk)
Date: 12/24/04
- Previous message: J West: "Re: Slightly OT : threads"
- In reply to: Gonzalo Torres: "Records lost in an ADOStoredProc"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 24 Dec 2004 18:51:36 -0000
Typically what I have done in the past is to set up a "Job" to run under
MSSQL as an overnight script.
The other option to do is to split the job into seperate functions and
process them as different jobs but this all depends on what your logic is
like.
Other alternatives to consider are
1) To set up a table view.
2) Set up a new table that contains all the data that you need and populate
using triggers on the tables that you are getting the information from
thereby "Pre-Processing" the data..
3) Check your SQL syntax in the stored procedure and make sure you are using
joins properly.
4) Use a thread to fire off the stored procedures so that your application
doesn't freeze!
5) Upgrade the server!
There are many other solutions to this problem and I am sure others will
have some good sugestions but you really need to post the SQL from the
stored procedures in order to check properly and the priority should be to
make sure that they are working as efficiently as possible so you are not
inadvertantly "Locking" other processes out.but strangling the network with
data traffic and or overloading the server.
If written/designed properly you should be able to process 100,000 records
in minuites!
Millions of phone bills can be calculated in a couple of hours and thats on
very old operating systems with old hardware!
Regards!
James West!
"Gonzalo Torres" <condormix2001@yahoo.com.mx> wrote in message news:41cb18d6
$1@newsgroups.borland.com...
> Hi
> I have a situation, I execute a TADOStoredProc
> to calculate salaries from different tables. This store procedure lasts
> about 45 minutes,
> and as it's executing in a synchronous mode, so it doesn't allow me to
> show a counter or
> a progress bar, until it finishes the process. Let's suppose it updates
> 75400 records.
> If I change the ExecuteOptions property it only updates 75398 records when
> the CacheSize is set to 1; it is worse when I increase the CacheSize.
> Furthermore AsyncFetch and AsyncFetchNonblocking set to True doesn't allow
> me to show a counter because it still freezes the program.
> I'm using Delphi 6 under WinXP.
> I don't want to change the threat priority. Even if I wanted to, I don't
> know how.
> I don't want to use the BetterADODataset either.
> I don't need to show records, only to execute the store procedure.
>
> If there's a way by using a recordset like the other examples? how can I
> solve the problem?
>
> Here is the code for the calling to the TADOStoreProc:
>
> procedure TPrima.GenerateSalaryClick(Sender: TObject);
> begin
> if strtofloat(MinimumSalary.text) <= 0 then
> showmessage('Wrong Salary')
> else
> begin
> Screen.Cursor := crSQLWait;
> DMNominaRep1.DatosRep1.ADOSTPPRIMAVAC.Parameters.Items[1].Value :=
> strtofloat(MinimumSalary.text);
> DMNominaRep1.DatosRep1.ADOSTPPRIMAVAC.Parameters.Items[2].Value :=
> sTRtOdATE(period.text);
> DMNominaRep1.DatosRep1.ADOSTPPRIMAVAC.Open;
> Screen.Cursor := crDefault;
> SHOWMESSAGE('Process Finished');
> end;
> end;
>
>
>
>
- Previous message: J West: "Re: Slightly OT : threads"
- In reply to: Gonzalo Torres: "Records lost in an ADOStoredProc"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|