473,386 Members | 1,962 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

SP speed via VB.NET compared with Query Analyzer

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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
2 2669
This is not an ADO.NET 'group,
(news://msnews.microsoft.com/microsof...mework.adonet),
however, I would reccomend running the SqlServer Profiler. Have you tried
this to see *exactly* what is getting executed?

Again, the ADO.NET 'group or SQL Server 'group is going to be much more
insightful when it comes to this type of thing.

HTH,
Jeremy
"Darin" <darin_nospam@nospamever> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 20 '05 #2
Hi,
Just a suggestion, but if you've enabled SQL Debugging in your project
properties, this will have a fairly moderate effect on performance when
executing SP's. Failing that, you might have more luck in the ADO.NET group
as I suspect this is something that's not directly related to VB.NET as much
as it is data access in the Framework, ie you'd probably get the same
behaviour if you were doing the same thing in C#.

Cheers,
Alex Clark
"Darin" <darin_nospam@nospamever> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #3

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

Similar topics

2
by: Wouter | last post by:
Hi, I was wandering. Does the query speed also depend on the colums that you don't use in the query (so not in the where and not in the select part). I have a lange unused backup field in...
5
by: Warren Wright | last post by:
Hi group, I have a select statement that if run against a 1 million record database directly in query analyzer takes less than 1 second. However, if I execute the select statement in a stored...
2
by: Poster | last post by:
After creating an IN clause from a bunch of character strings created by a Word macro, Query Analyzer complains about a syntax error. The macro takes a column full of character strings and wraps...
3
by: JM | last post by:
Good day. I was able to connect to a database server using SQL Server Enterprise Manager. The Server name specified on the tree is JOMARGON(Windows NT). But no server was detected using either...
5
by: JENS CONSER | last post by:
Hello NG, We have a performance problem in using a client server solution based on MS SQL-Server 2000 through a VPN tunnel (via broadband internet connection). The SQL Server is running on a...
1
by: justinjoylife | last post by:
Hi - I'm completely new to Microsoft Query Analyzer and I need to learn it for work to do data mining as a Product Manager. Does anyone have any recommendations on how to learn this and where?...
60
by: Neil | last post by:
I have a situation with an ODBC linked view in an Access 2000 MDB with a SQL 7 back end. The view is scrolling very slowly. However, if I open the view in an ADP file, it scrolls quickly. I...
2
by: jphelan | last post by:
Ever since I successfully applied some techniques for increasing the speed of my 17 meg. Application; it has only made me hunger for more. First, let me list what I have done so far: 1. Split...
1
by: chudson007 | last post by:
Hi All, What are the pros and cons between using Enterprise Manager or Query Analyzer for my queries. Currently I use Enterprise Manager because I prefer the interface and only use Query...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...

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.