473,748 Members | 7,608 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Best way to call a stored procedure

H

There are two ways to execute a stored procedure using ADO.NE
- call "exec sp_myproc val1,val2" statement over SqlCommand myCommand = new SqlCommand(SQLQ uery, mySqlConnection )
- use Command/Parameters objects to initialize and call the stored procedure

Which is a efficient way and wh

Appreciate your respons

Thank
Mike

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
Nov 16 '05 #1
2 3246
Hello,
Stored procedures are better. Statements are precompiled in the server, and
thus will be much faster when being executed.
Hope it's convincing.

Regards,
Rami Saad
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #2
On 22 Jun 2004 15:25, "Rami Saad" wrote:
Hello,
Stored procedures are better. Statements are precompiled in the server, and
thus will be much faster when being executed.
Hope it's convincing.

Regards,
Rami Saad
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC


Possibly faster, sometimes. Much faster? Nope.

http://weblogs.asp.net/fbouma/archiv.../18/38178.aspx and various
related blogs and discussions such as: http://dotnetjunkies.com/WebLog/harp...1/18/3676.aspx
And
http://weblogs.asp.net/rhoward/archi.../18/38298.aspx
The first link above quotes this from BOL:
<BOL>
SQL Server 2000 and SQL Server version 7.0 incorporate a number of changes
to statement processing that extend many of the performance benefits of
stored procedures to all SQL statements. SQL Server 2000 and SQL Server
7.0 do not save a partially compiled plan for stored procedures when they
are created. A stored procedure is compiled at execution time, like any
other Transact-SQL statement. SQL Server 2000 and SQL Server 7.0 retain
execution plans for all SQL statements in the procedure cache, not just
stored procedure execution plans. </BOL>

So I'm not convinced, I'm afraid :)
--
Simon Smith
simon dot s at ghytred dot com
http://www.ghytred.com/NewsLook - Usenet for Outlook
Nov 16 '05 #3

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

Similar topics

0
6703
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft Visual Basic .NET version of this article, see 308049. For a Microsoft Visual C++ .NET version of this article, see 310071. For a Microsoft Visual J# .NET version of this article, see 320627. This article refers to the following Microsoft .NET...
3
24007
by: Mariusz | last post by:
I want to write function to call another function which name is parameter to first function. Other parameters should be passed to called function. If I call it function('f1',10) it should call f1(10). If I call it function('f2',5) it should call f2(5). So far i tried something like CREATE FUNCTION . (@f varchar(50),@m money) RETURNS varchar(50) AS
4
3244
by: Jean-Marc Blaise | last post by:
Dear all, I have simulated the windows MULTI application with a java program calling the SQLTP1DL proc referenced as DB2DARI application, on Linux Intel or ZLinux. If the proc is NOT FENCED, there is no pb and the program works fine. If either the proc is FENCED, or FENCED THREADSAFE, I get a SQL1042C, or the instance crashes on ZLinux (V8.1 FP4). The proc does a return(SQLZ_HOLD_PROC): $ /opt/IBMJava2-131/bin/java sqltp1ri 1
1
382
by: mike | last post by:
H There are two ways to execute a stored procedure using ADO.NE - call "exec sp_myproc val1,val2" statement over ADO SqlCommand myCommand = new SqlCommand(SQLQuery, mySqlConnection) - use Command/Parameters objects to initialize and call the stored procedure Which is a efficient way and wh Appreciate your respons
0
4241
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET Applications and owner of Access Microsystems. Doug can be reached at doug@accessmicrosystems.com. --------------------------------------------------------------------------------
3
15797
by: mandible | last post by:
I'm trying to call one stored procedure inside another. I was wondering if this is possible Some ideas I was toying with is putting the first stored procedure inside of a temp table but haven't been able to get this idea to work.
7
3583
by: Steve | last post by:
I am building an object library for tables in a database. What is the best practice for creating objects like this? For example, say I have the following tables in my database: User: - Id - FirstName - LastName - CompanyId (many-to-one )
2
10571
by: savio XCIX | last post by:
I created the following stored procedure: ======= CREATE PROCEDURE TBLNAME.proc_test (IN p_custnum VARCHAR(8), IN p_zipcode CHAR(5), OUT r_valid CHAR(1), OUT r_bal DECIMAL(9,2)) LANGUAGE SQL BEGIN
12
30942
by: barmatt80 | last post by:
I don't know if this is the right part of the forum. But.... I have been working all night trying to create a web service to call a stored procedure in sql server 2008. The stored procedure calls a linked server to a db2 database that accepts 1 integer and returns 6 variables. The end result would be publish the web service to our sharepoint servers. This is not a problem. I am just trying to wrap my head around it. I know how to call...
0
8989
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8828
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9537
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9367
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8241
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6795
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3309
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
3
2213
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.