Solved

Stored Procedure Slow through Powerbuilder

Posted on 2010-08-30
4
1,033 Views
Last Modified: 2013-12-26
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,
0
Comment
Question by:byteboy11
  • 2
  • 2
4 Comments
 
LVL 14

Expert Comment

by:sandeep_patel
ID: 33568482
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
0
 

Author Comment

by:byteboy11
ID: 33568977
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
0
 
LVL 14

Accepted Solution

by:
sandeep_patel earned 500 total points
ID: 33646902
Instead of ODBC, try to use SQL Server Native Drivers. Also in ODBC profile confirm 'Trace ODBC API Calls' is not checked on 'Options' tab or not mentioned in your SQLCA connection profile.

Is this the only procedure takes long time or the same behaviour with any procedure call?

Regards,
Sandeep
0
 

Author Closing Comment

by:byteboy11
ID: 33961479
good answer
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now