Execution of Stored Procedure - Timed Out Error

Execution of Stored Procedure - Timed Out Error

Post by Sri » Thu, 16 May 2002 15:45:05



Hi Everybody,

One of the user had written a Stored Procedure with 600
lines. The Problem is when it is called from 'ASP', it
says 'Timed Out Error'. But when we compile this Stored
Procedure in Query Analyzer, it executed without any
error. After that 'ASP' users able to use this Stored
Procedure with out any problem, I mean 'Timed Out Error'
is not coming.

So we hv been doing this for the past 10 days. That is if
users execute from 'ASP' for the first time, the error
comes. But once it is compiled in Query Analyzer, we are
not facing this problem. I don't know, why?.

When I went through the Stored Procedure, I am able to see
lot of blank lines and unnecessary spaces. If we truncate
those lines it may come around 350 lines only.

I want to know, because of these unnecessary Blank Lines
or Spaces is it possible for that error('Timed Out
Error').  Can anybody guide me on this?

tks in advance,
Sri

 
 
 

Execution of Stored Procedure - Timed Out Error

Post by Sri » Thu, 16 May 2002 15:44:59


Hi Everybody,

One of the user had written a Stored Procedure with 600
lines. The Problem is when it is called from 'ASP', it
says 'Timed Out Error'. But when we compile this Stored
Procedure in Query Analyzer, it executed without any
error. After that 'ASP' users able to use this Stored
Procedure with out any problem, I mean 'Timed Out Error'
is not coming.

So we hv been doing this for the past 10 days. That is if
users execute from 'ASP' for the first time, the error
comes. But once it is compiled in Query Analyzer, we are
not facing this problem. I don't know, why?.

When I went through the Stored Procedure, I am able to see
lot of blank lines and unnecessary spaces. If we truncate
those lines it may come around 350 lines only.

I want to know, because of these unnecessary Blank Lines
or Spaces is it possible for that error('Timed Out
Error').  Can anybody guide me on this?

tks in advance,
Sri

 
 
 

Execution of Stored Procedure - Timed Out Error

Post by Tibor Karasz » Thu, 16 May 2002 15:55:12


My guess is that the first time you execute the proc, SQL Server has to compile it. That takes a
while, so long that it exceeds your time-out. Just increase the time-out in the app and have the
first user take that penalty. Removing blanks will most probably make no noticeable difference.

--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sql...


Quote:> Hi Everybody,

> One of the user had written a Stored Procedure with 600
> lines. The Problem is when it is called from 'ASP', it
> says 'Timed Out Error'. But when we compile this Stored
> Procedure in Query Analyzer, it executed without any
> error. After that 'ASP' users able to use this Stored
> Procedure with out any problem, I mean 'Timed Out Error'
> is not coming.

> So we hv been doing this for the past 10 days. That is if
> users execute from 'ASP' for the first time, the error
> comes. But once it is compiled in Query Analyzer, we are
> not facing this problem. I don't know, why?.

> When I went through the Stored Procedure, I am able to see
> lot of blank lines and unnecessary spaces. If we truncate
> those lines it may come around 350 lines only.

> I want to know, because of these unnecessary Blank Lines
> or Spaces is it possible for that error('Timed Out
> Error').  Can anybody guide me on this?

> tks in advance,
> Sri

 
 
 

Execution of Stored Procedure - Timed Out Error

Post by Sri » Thu, 16 May 2002 16:22:02


Thanks for your reply.

But we have increased enough time in ASP. Still having the
same problem. The execution time that it takes in Query
Analyzer is very very less than the time that we hv set in
ASP.

Why I am not getting 'Timed Out Error' in QA and also why
it is working fine without any error in ASP after it is
executed first time in 'Query Analyzer'. Why ASP not able
to execute the stored procedure in first time even though
it has got enough time set in the settings.

Can anybody help me.

tks in advance,
Sri.

Quote:>-----Original Message-----
>My guess is that the first time you execute the proc, SQL

Server has to compile it. That takes a
Quote:>while, so long that it exceeds your time-out. Just

increase the time-out in the app and have the
Quote:>first user take that penalty. Removing blanks will most

probably make no noticeable difference.
Quote:

>--
>Tibor Karaszi, SQL Server MVP
>Archive at: http://groups.google.com/groups?

oi=djq&as_ugroup=microsoft.public.sqlserver



>> Hi Everybody,

>> One of the user had written a Stored Procedure with 600
>> lines. The Problem is when it is called from 'ASP', it
>> says 'Timed Out Error'. But when we compile this Stored
>> Procedure in Query Analyzer, it executed without any
>> error. After that 'ASP' users able to use this Stored
>> Procedure with out any problem, I mean 'Timed Out Error'
>> is not coming.

>> So we hv been doing this for the past 10 days. That is
if
>> users execute from 'ASP' for the first time, the error
>> comes. But once it is compiled in Query Analyzer, we are
>> not facing this problem. I don't know, why?.

>> When I went through the Stored Procedure, I am able to
see
>> lot of blank lines and unnecessary spaces. If we
truncate
>> those lines it may come around 350 lines only.

>> I want to know, because of these unnecessary Blank Lines
>> or Spaces is it possible for that error('Timed Out
>> Error').  Can anybody guide me on this?

>> tks in advance,
>> Sri

>.

 
 
 

Execution of Stored Procedure - Timed Out Error

Post by Ranji » Thu, 16 May 2002 18:14:44


I guess u are executing the procedure with the Command Object.
If so, then set the CommandTimeout Property = 0. By default it is 30. When u
set it to 0, the stored proc will run untill executed.

hope this helps!
ranjit


> Thanks for your reply.

> But we have increased enough time in ASP. Still having the
> same problem. The execution time that it takes in Query
> Analyzer is very very less than the time that we hv set in
> ASP.

> Why I am not getting 'Timed Out Error' in QA and also why
> it is working fine without any error in ASP after it is
> executed first time in 'Query Analyzer'. Why ASP not able
> to execute the stored procedure in first time even though
> it has got enough time set in the settings.

> Can anybody help me.

> tks in advance,
> Sri.

> >-----Original Message-----
> >My guess is that the first time you execute the proc, SQL
> Server has to compile it. That takes a
> >while, so long that it exceeds your time-out. Just
> increase the time-out in the app and have the
> >first user take that penalty. Removing blanks will most
> probably make no noticeable difference.

> >--
> >Tibor Karaszi, SQL Server MVP
> >Archive at: http://groups.google.com/groups?
> oi=djq&as_ugroup=microsoft.public.sqlserver



> >> Hi Everybody,

> >> One of the user had written a Stored Procedure with 600
> >> lines. The Problem is when it is called from 'ASP', it
> >> says 'Timed Out Error'. But when we compile this Stored
> >> Procedure in Query Analyzer, it executed without any
> >> error. After that 'ASP' users able to use this Stored
> >> Procedure with out any problem, I mean 'Timed Out Error'
> >> is not coming.

> >> So we hv been doing this for the past 10 days. That is
> if
> >> users execute from 'ASP' for the first time, the error
> >> comes. But once it is compiled in Query Analyzer, we are
> >> not facing this problem. I don't know, why?.

> >> When I went through the Stored Procedure, I am able to
> see
> >> lot of blank lines and unnecessary spaces. If we
> truncate
> >> those lines it may come around 350 lines only.

> >> I want to know, because of these unnecessary Blank Lines
> >> or Spaces is it possible for that error('Timed Out
> >> Error').  Can anybody guide me on this?

> >> tks in advance,
> >> Sri

> >.

 
 
 

1. Time-outs on only 2 of many stored procedures

I recently rebuilt our windows 2000 server from the ground up.  Everything seems to run as it did on the previous server, except for 2 stored procedures.  I am a self-taught, on-the-fly VB/SQL programmer and am not sure what is causing this problem.  Actually, I'm not sure what information, exactly, to provide in this post to help others help me.

I can tell you this though.  I auto generated scripts from the previous server to create the database (tables & stored procedures) on the new server.  I then re-loaded data to those tables using DataJunction (as we always do once a month).  The data is all there and loaded without issue.  Nearly every time I run the program in debug mode, I get the time-out problem.  Both the stored procedures that are timing out access the same table and are called one after the other.  One gets a recordset and the other does a query on each of those records looking for more specific information within the same table.  If certain criteria is met, the record is not inserted into a new table.  

About 1/2 the time the 1st stored procedure succeeds without a timeout.  When this occurs I invariably get the timeout on the second stored procedure.  When run from the executable, records that should not be inserted into the new table are therefore being inserted, which causes a report to be generated that never should have been generated.  I did not change anything (that I know of) from the previous server to this new server for these two particular stored procedures.

Things I've tried:
a) increasing the timeout setting from 120 sec. to 240 sec.
b) adding a "DoEvents" statement just before each stored procedure call.
c) removing recent code changes that were unrelated to this portion of my code.  Note: I did not discover the problem before making other code changes, but assume the issue was present on this particular server  before those changes took place, although I have no proof either way.

Things I'm currently in the process of trying:
c) verifying that indexes I might have set up on previous server possibly didn't get scripted and carried over to the new server.
d) deleting the table, rebuilding it, and re-populating it with data.

My Question is: Does anyone have any suggestions as to what could be causing these time-outs?

Thanks in advance,
Theresa

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

2. Larry Ellison

3. Execution of Stored Procedure - Timed Out Error

4. HELP!!! UNIX groups and Informix roles driving me nuts!!!

5. store procedure date/time last execution

6. 4 Different bankends

7. Timed Execution of Stored Procedures

8. DOPATCH says "foxw2600.esl is not a baseline file"

9. Execution Time of Store Procedure

10. How to measure Store Procedure execution time?

11. Defer execution of Stored Procedure until some time in the future

12. Factors involved in the execution time of Stored Procedures

13. Help with SQL execution time (stored procedure?)