By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,302 Members | 1,788 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,302 IT Pros & Developers. It's quick & easy.

Best way to call a stored procedure

P: n/a
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(SQLQuery, 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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.