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
Joginder BangerRank #360 · 7K reputationPosted Nov 12, 2014, 9:42 PM EST
Store Procedure is a main concept in programming line. we can work without store procedure but some problem will be occur. Sql Injection it is dangerous for our development link. for more info about the Sql injection hit this link
http://www.programmerinterview.com/index.php/database-sql/sql-injection-example/
. A store procedure is protect our sql query.
for example I search the records behalf on customer Mobile Number. I need a textbox and one button . I written a simple query
sqlCommmand com= new SqlCommand("select * from tablebame where mobileNO='"+textbox1.text'",connection string");
//another do stuff here
it's work fine. if we enter in the textbox --select * from table. query automatic comment and all data return.
This type of problem store procedure protect.
no need compile every time. A lot of advantage if we used the Store procedure.
rgowthamraj ramajayam51 reputationPosted Nov 13, 2014, 2:54 AM EST
Joginder BangerRank #360 · 7K reputationPosted Nov 13, 2014, 2:58 AM EST
rgowthamraj ramajayam51 reputationPosted Nov 13, 2014, 3:25 AM EST
Joginder BangerRank #360 · 7K reputationPosted Nov 13, 2014, 5:12 AM EST
create proc testing
(
@sample varchar(max)=null // assign the null value is optional.
)
as
declare @tempid int
begin
select @tempid=columnname from tablename1 where columnname=@sample
another table define below
select * from tablename2 where columnname=@tempid
end
i hope you understand.