HI,
What is the Stored procedure in Sql Server ?
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
Prasant JinagaRank #2,383 · 594 reputationPosted Mar 19, 2012, 10:43 PM EDT
Stored Procedures are nothing but special objects available in sql server. Its a precompiled statements where all the preliminary parsing operations are performed and the statements are ready for execution.
Its very fast when compared to ordinary sql statements where the sql statements will undergone a sequence of steps to fetch the data
Stored procedure involves various syntax based on the parameters passed.
Here is the syntax to create SP's
Create procedure SPName
as
begin
----Your query should be return here
end
To execute the stored procedure we have to use exec command,
Exec SPName
Thats it!!!
Thanks,
Prasant
Jignesh TrivediRank #16 · 50.3K reputationPosted Mar 19, 2012, 10:51 PM EDT
A stored procedure is a subroutine or special function available to applications that access a relational database system.
SP in SQL are similar to procedures in other programming languages.
http://msdn.microsoft.com/en-us/library/ms191436%28v=sql.90%29.aspx
also refer our recommended article(just right side of this web page).
SenthilkumarRank #387 · 6.5K reputationPosted Mar 19, 2012, 11:51 PM EDT
It will helps to increase the performance of the applications. Because its compiled once and it will use the same execution plan for all the subsequent requests.
It will accept parameters and returns the result set as tables. It can call the functions and other stored procedures.
The advantages and tips to increase the performance have been written in another article by me.
http://www.c-sharpcorner.com/UploadFile/skumaar_mca/good-practices-to-write-the-stored-procedures-in-sql-server/