Stored procedure results in 100% cpu load

Posts   
 
    
wvnoort
User
Posts: 96
Joined: 06-Jan-2005
# Posted on: 11-Sep-2007 15:08:15   

Another (small) problem in our upgrade to SqlServer 2005: When executing a RetrievalProcedure the cpu load on the database server goes to 100% (called from an ASP.NET application) and runs forever. The stored runs within 2 second when you execute it from the Sql Management Studio. The cpu load on the webserver does not exceed the 10% and there is almost no network traffic.

When i set the compatibility level to 80 (Sql Server 2000) this behavior disappears.

Is this a known problem, or are updated runtime libraries available? The app in question still uses version 1.0.2004.2.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39910
Joined: 17-Aug-2003
# Posted on: 11-Sep-2007 18:31:34   

A retrieval proc is called by passing a SqlCommand to the SqlDataAdapter.Fill() method to fill a datatable/set.

so what's sent to the db is the proc name, the parameters and some execution fluff around it, e.g. EXEC ... which is done by the SqlClient, we just pass the proc name and the parameters.

Could you check with a profiler what the db receives (which is out of our hands btw, it's produced by sqlclient.SqlDataAdapter, which calls internally SqlCommand.ExecuteCommand) and whats eating the CPU cycles? 1.0.2004.2 does use .net 1.1, perhaps some bug in .net 1.1 causes this?

Frans Bouma | Lead developer LLBLGen Pro