473,394 Members | 1,640 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Invoking stored procedure takes a long time to start

132 100+
Hi there. I have a stored procedure which when invoked using EXEC in Sql Server Management Studio takes about 20 minutes to even start.

The EXEC command includes two input variables which hold XML strings of data, so I'm not sure if this would impact the startup at all?

Once the procedure does start, it finishes quite quickly but I can't see what is causing it to wait for so long to begin processing.

I have included debug statements within the stored procedure so I can see what step may be causing the bottle neck, but it doesn't even try to reach the first of these debug statements for a very long time so it just appears to hang for no reason, then it kicks off and all is good.

Any idea(s) on what causing the stored procedure to be inactive please? Is there some state in Sql Server that acts like a thread wait or the such?

Any help will be most welcome.

Thank you.
Dec 29 '10 #1
5 3004
ck9663
2,878 Expert 2GB
There are a lot of reason why.

Put a SELECT 1 on the first line and then RETURN. If that happens immediately, then your SP runs fast, it's whatever inside it is making it slow.

Also, the debug feature that you might be waiting for to appear might be affected by I/O of the server, or the client or the network. So it has a lot of factors.

Good Luck!!!

~~ CK
Dec 29 '10 #2
E11esar
132 100+
Yes I have done that with the stored procedure and it now takes about an hour to hit that first line.

Really is a strange one this.

Have tried Google-ing but so far no luck.

Thank you.
Dec 29 '10 #3
ck9663
2,878 Expert 2GB
How big is your XML?

~~ CK
Dec 29 '10 #4
E11esar
132 100+
Each XML statement is about 10 lines long: probably around 300 charachters in length altogether.

An additional curiosity is I have replaced the series of SELECT 1 debugging statements with select getdate() statements so I can see what time each statement is hit and hence calculate how long specific portions of code take to process, and what I am getting back is getdate() values equal to when I started the stored procedure but these getdate()'s are not displaying for a good 50 minutes..!

It is as though the stored procedure is running but not sending a response for 50 minutes.

Very curious indeed.
Dec 29 '10 #5
ck9663
2,878 Expert 2GB
I cannot say for sure what's going on until I see your SP. But based solely on your results, it's more of an I/O problem.

Good Luck!!!

~~ CK
Dec 29 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Karaoke Prince | last post by:
Hi There, I have an update statement to update a field of a table (~15,000,000 records). It took me around 3 hours to finish 2 weeks ago. After that no one touched the server and no...
0
by: JJ | last post by:
Hi, I'm having a little problem. I use the following code to open a .pdf file from one app. : System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(); string path...
7
by: nicholas | last post by:
I have a page that changes some data in an sql-server database: it inserts the categories for a selected product. The user checks some categories in a tree (with checkboxes). These are the...
1
by: mike | last post by:
Hi, Starting a debug session used to take about 2-3 seconds. I took the project home and worked on my laptop at home, burned it onto CD then brought it back to work. Now it takes 15-20 seconds...
4
by: Brian | last post by:
Hello, I have a vb.net web app that I am doing reads and adds to a database. Everything works fine and happens instantly. I recently added an update and it takes a long time to finish. I was...
0
by: John Smith | last post by:
Hello, I have 7 different crystal reports that need to be collated. Since I want to end up with a page of each (which all together make a single report), I created a blank main report and then...
2
by: Jason Huang | last post by:
Hi, I am wondering why it takes a long time to open an .aspx file at the first time in a browser. Are there some methods to improve that speed? Given that we are using the IIS5+VS2005 C#....
2
by: dougancil | last post by:
I have a form that requires me to execute several stored procedures one after the other. I'm wondering how to do that in vb.net. I realize that I could just have one stored procedure with all of my...
0
by: pramodds | last post by:
Hi All, I have SQL db2 stored procedure and currently on db2 9.5 version. Its federated environment where the stored proc queries certain tables in one database and loads that data in another...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.