Query taking to long in .net

A

Adam

I have a stored procedure that when executed from Query
Analyzer takes 0 to 1 second. When executing the same
procedure from .Net using any number of methods the page
just seems to get stuck on executing the command. It will
eventually come up, but takes about 5 minutes or so. The
result set from the query is about 300 rows, so it's
nothing that should ever take very long. All of my
indexes are set and as I stated above the query executes
extremely fast in query analyzer.

This isn't the only query we've had this problem with
either, so I'm at a loss as to why this is happening. Any
ideas would be appreciated.

We are using SQL Server 2000 on Windows Server 2003.

Thanks,

Adam
 
P

Patrice Scribe

What if you return the number of rows and test just this call in his own
unit testing page ? You could also capture the SQL sent. Time also to make
sure the time is not spend somewhere else than you think.

If still behaves this way, it looks like some kind of tracing is enabled
between the Web Server and the SQL Server. You could perhaps do a small .NET
app that just call this page and test if from the web server and the machine
on which you are using Query alnalyzer...

Good luck.
 
G

Greg

Use Sql Profiler and see how long you are actually in sql server...this
could be a code problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top