Pravin More
posted
358 posts
since
Jul 29, 2011
from
|
|
Re: What is Stored procedure
|
|
|
|
|
|
|
|
|
|
Hello Abhi,
Have you ever written SQL statements, like inserts, selects, and updates? Then you have already written most of a stored procedure. A stored procedure is an already written SQL statement that is saved in the database. If you find yourself using the same query over and over again, it would make sense to put it into a stored procedure. When you put this SQL statement in a stored procedure, you can then run the stored procedure from the database's command environment .
Click Here for more information.
Thanks, Pravin.
|
|
|
|
|
mark "This is correct answer" If this post help you.
|
|
|
|
|
|
Satyapriya Nayak
posted
2264 posts
since
Mar 24, 2010
from
|
|
Re: What is Stored procedure
|
|
|
|
|
|
|
|
|
|
Hi Abhi,
Its nothing but a set of T-SQL statements combined to perform a single task of several tasks. Its basically like a Macro so when you invoke the Stored Procedure, you actually run a set of statements. Stored Procedure are the precompiled set of sql command. Stored procedures means containing a precompiled block of code. if we call stored procedures they need not compiled, only execution takes place. With this advantage, work on database is less.
Please refer the below link
http://www.c-sharpcorner.com/uploadfile/puranindia/stored-procedures/default.aspx
Thanks
|
|
|
|
|
|
Senthilkumar
posted
1057 posts
since
Jul 28, 2009
from
Bangalore
|
|
Re: What is Stored procedure
|
|
|
|
|
|
|
|
|
|
|
The stored procedure is bundle of T-SQL statement which is compiled and stored as object under the database. It can accept the parameter as arqument and it will avoid the network traffic. When it executes the first time it will create the execution plan and for all the subsequent request it will use the same execution plan. So the execution time will be fast when compare with the inline queries.
You can query the stored procedures list from the following query. SELECT * FROM SYS.PROCEDURES
It has some advantages like -Avoid sql injection -Fast execution compare to the inline queries -Multiple application can use the same procedures -Permission can be set the stored procedure -Business logics in the procedure can be changed with out modifying the source code and redeployment.
|
|
|
|
|
If this post is useful then mark it as "Accepted Answer"
|
|
|
|
|
|