sql query or stored procudre which one is giving best performance in asp.net

T

tulasikumar

hi all,
i have one doubt regarding queries and stored procedures.i am doing asp.net
project,i had written both query based retriving and stored procudures.I
want know about which one was giving best performance.and one more is when i
am passinf sql statement or stored procedure to sqlserver how these to
executed internally.
please tell me the answer these queries

thanks in advance
 
A

Aidy

Stored procedures are better for performance. When you create one, SQL
server stores an execution plan with it. When you execute a SQL query
direct the database needs to create the execution plan each time. I think
more up-to-date versions of SQL Server have more advanced caching of these
things, I'm not that sure. SPs are also easier to write (I think) and
debug.
 
B

bpd

And SP can be reused. They can also be changed without having to
recompile/deploy .Net code.
 

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

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top