473,668 Members | 2,373 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 3242
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
6695
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
23999
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
3242
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
4221
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
15781
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
3577
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
10563
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
30931
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
8459
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
8378
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
8653
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6206
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
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4202
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2786
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
2
2018
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1783
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.