473,563 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQLExecute takes 100% CPU usage

Hi
I a am executing a stored procedure from C code using SQLExecute . It
takes some time to Execute the procedure. However when I see the
processor usage during that time it shows 100% cpu usage.
Can anyone tell me why SQLExecute uses 100% CPU when running the
stored proceudre.
Thanks
vishal
Jul 20 '05 #1
2 4859
vishal (vi************ **@mentorix.com ) writes:
I a am executing a stored procedure from C code using SQLExecute . It
takes some time to Execute the procedure. However when I see the
processor usage during that time it shows 100% cpu usage.
Can anyone tell me why SQLExecute uses 100% CPU when running the
stored proceudre.


Too little information to say anything useful. The only thing I can think
of is that the stored procedure produecs a huge result set.
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2
If your application is running on the same machine as SQL Server, use
taskmgr to identify the process consuming the CPU. If sqlservr.exe is the
culprit, some query tuning is probably needed. You can examine the
execution plan using Query Analyzer and
modify the proc and/or experiment with indexes to make it more efficient.

If your client application is consuming the CPU, a large result may be to
blame as Erland indicated.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"vishal" <vi************ **@mentorix.com > wrote in message
news:f1******** *************** ***@posting.goo gle.com...
Hi
I a am executing a stored procedure from C code using SQLExecute . It
takes some time to Execute the procedure. However when I see the
processor usage during that time it shows 100% cpu usage.
Can anyone tell me why SQLExecute uses 100% CPU when running the
stored proceudre.
Thanks
vishal

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1568
by: Philippe Trottier | last post by:
Hi! We developped a program with VS2003 and Enterprise Library. then we switched to VS2005B2 to check the conversion between these two. Everything works fine now except one thing! The sql queries I execute on the database take much longer to execute. We have for example a query that selects all rows from a table that contains about 6000...
5
3245
by: Ken Brubaker | last post by:
Using DB2 8.1 FP5 on Win2000 After creating and configuring a new database, we stop db2 and start it again. We then launch our application and the SQLExecute calls start slowly and get progressively slower. Our application basically looks like this: get an environment handle get a connection handle connect to the database while we...
2
2113
by: wushupork | last post by:
I have written a screensaver application in C# .NET and have noticed that whenever the animation loop is running - CPU usage always spikes up close to 100%. My application uses a paint thread which is set at 100ms. the program looks sort of like this: // constructor public Form1() {
1
1459
by: Jerry Bujas | last post by:
Can someone explain, please, why it takes for a vc++ project (form application) comprising three forms about four miniutes to load at 100% CPU usage? When it finally loads and I want to run the program, the compiler recompiles all the files (about 50 of them), despite the fact that the program had been recompiled before exiting the compiler....
11
4610
by: David Schwartz | last post by:
When I run my VB.NET Windows Forms application, the CPU usage jumps up to 100%. If I drop-down a menu, the usage goes down to a more reasonable number, like 0-2%. The same is true when a MsgBox comes up. Has anyone else noticed or experienced this? Why would this be? Is this the norm for VB.NET apps? Thanks in advance.
22
31950
by: Paul | last post by:
Hi I am having a real issue with CPU usage by SQL Server, and it is not related to a poor query. I have a clients database that I am currently investigating some issues with. After I perform a standard task using the application, and the results have been returned to the application the cpu usage remains at 100%.
4
2981
by: Paul | last post by:
Hi all Please read my previous post here if this interests you: http://groups.google.co.uk/group/comp.databases.ms-sqlserver/browse_frm/thread/d5b12d2dadd16465?page=end&q=100%25+cpu+usage&hl=en& I have (or rather a colleague has) found the situation that appears to be causing this problem but I am still no further to finding a solution.
5
1632
by: fniles | last post by:
I am having problem with thread. I have a Session class with public string variable (called Message) that I set from my Main program. In the session class it checks for the value of Message while inside it's "read loop" waiting for data from the client. In the main program, I check to see if the Message member has been cleared before...
12
12137
by: elty123 | last post by:
I have a small C# program (about 400 lines of code) that is only 28kb after compiled. However when it runs (takes a whole 5 seconds) it takes up nearly 20MB of memory and I don't see why. Some of the assembly I used: using System; using System.Collections.Generic;
0
7580
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7882
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. ...
0
8103
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7634
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...
0
7945
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3618
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2079
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
1
1194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
916
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...

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.