SP speed via VB.NET compared with Query Analyzer

D

Darin

I have a stored procedure with 15 arguments that, when run using Query
Analyzer takes 2.5 minutes to run. In my VB.NET code, when I go to run
the same SP with the same parameters, I get a timeout message after 15
minutes.

Why would VB take 5 times longer to run the same SP?

Below is how I run it in VB:

strcommand=new sqlcommand(in_sp, xconn)
strcommand.commandtype=commandtype.storedprocedure
for each xpar in in_param
xparam=new sqlparameter(xpar.setname, xpar.setvalue)
strcommand.parameters.add(xparam)
next
strcommand.timeout=900 '15 minutes
strcommand.executescalar

In_Param is my own class that has the parameter name and value in it.


TIA


Darin
 

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