Link to home
Start Free TrialLog in
Avatar of byteboy11
byteboy11Flag for United States of America

asked on

Stored Procedure Slow through Powerbuilder

I have a stored procedure that executes within 3 minutes from the SQL Server 2005 console but when I call the same procedure from within my Powerbuilder App it takes 40 minutes.

Are there any things to look for as to why there would be such a huge difference in run times?

Thanks,
Avatar of sandeep_patel
sandeep_patel
Flag of United States of America image

Is there something you call the procedure in a loop from powerbuilder?
Are you calling procedure from datawindow?
What drivers you are using for database connection?
It would be better if you paste the code here about how you call it from both sql console and powerbuilder for comparison...

Regards,
Sandeep
Avatar of byteboy11

ASKER

There is no looping in the PB side code.
Not calling from a datawindow just calling directly
Using ODBC drivers


This is the PB Code(1 hour to run):
DECLARE sp_import_my_data PROCEDURE FOR
sp_import_my_data :ai_do_insert,:il_emp_id,:is_data_desc,:li_override
USING SQLCA ;
EXECUTE sp_import_my_data ;


This is how I'm running it from the sql 2005 query analyizer window(3min to run):
exec sp_import_my_data 1,'1','test import1',0
ASKER CERTIFIED SOLUTION
Avatar of sandeep_patel
sandeep_patel
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
good answer