Hi,
What is Stored procedure in Database?
Thanks.
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Pravin MoreRank #1,419 · 1.2K reputationPosted Feb 8, 2012, 7:43 PM EST
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.
Satyapriya NayakRank #47 · 31.5K reputationPosted Feb 8, 2012, 7:44 PM EST
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
SenthilkumarRank #387 · 6.5K reputationPosted Mar 2, 2012, 1:51 AM EST
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.