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

  • Thread starter Thread starter tulasikumar
  • Start date Start date
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
 
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.
 
And SP can be reused. They can also be changed without having to
recompile/deploy .Net code.
 
Back
Top