473,793 Members | 2,742 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Invoking stored procedure takes a long time to start

132 New Member
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 3023
ck9663
2,878 Recognized Expert Specialist
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 New Member
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 Recognized Expert Specialist
How big is your XML?

~~ CK
Dec 29 '10 #4
E11esar
132 New Member
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 Recognized Expert Specialist
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
18188
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 configuration changed. Until yesterday, I re-ran it again and it took me more than 18hrs and still not yet finished!!! What's wrong with it? I can ran it successfully before. I have tried two times but the result was still the same.
0
3006
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 = @dir+"\\"+myDataTable.Rows.ToString();
7
3592
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 categories where the selected product belongs to. These checked categories are listed in a textbox named "theIDs" (ex: 25,116,420) In the texbox named "chk_counter" there is the number of selected categories: in this example: 3 So, in the table, I...
1
1428
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 to start a debug session. Anyone have any ideas on what could've caused this. (By the way, I already went in and removed the "read-only" status of all folders/files that resulted from the CD.)
4
2067
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 wondering if there was anyone else who experenced this problem and if there are any ways around it? Dim MySQL As String MySQL = "UPDATE db SET Var1 = 'Y' WHERE aimtno = " & tnum & " and abook = " & tbook Dim strConn As String =...
0
5777
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 added the 7 as subreports so they can print one after the other. I'm supposed to be printing them from a VB.Net 2003 application and I will be passing 2 parameters (start and end dates). These reports are huge (over 1000+ pages each). My original...
2
1546
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#. Thanks for help. Jason
2
1618
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 queries in it, but for clarities sake, I want to keep them seperate. Thank you Doug
0
1956
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 database. Both the database are in the same instance. This Stored procedure call was getting completed in one or two minutes max. But from last one week this stored procedure is taking 40-50 mins to complete. There is nothing that has changed recently....
0
9671
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10433
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10161
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6777
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4112
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2919
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.