Performing crud the procedure is best than query?
whch
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
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 attend4days leftRegister
Sunny SharmaRank #223 · 11.1K reputationPosted Jun 7, 2013, 12:56 AM EDT
Pankaj PandeyRank #642 · 3.7K reputationPosted Jun 7, 2013, 2:11 AM EDT
It restrict sql injection and provide other many type of security that a query can not provide.
Use of procedure is better to be safe your database from a unknown entry through your application that is connected to your database.
Jignesh TrivediRank #16 · 50.3K reputationPosted Jun 7, 2013, 3:07 AM EDT
hi,
As per me,
SQL Server caches the execution plans for ad-hoc queries, so the two approaches will be identical in terms of speed.
the use of stored procedures means taking a portion of the code putting out side of your C# Code mean source control.
all Query is in center location is good thing,depending upon how many different applications need to access to the data.
also i Prefferd fully parameterized adhoc Query.
Also SP is really good performance in case of some operation tobe performed on Data base and insert/update related tables.
SP and parameterized adhoc Query, can able to prevent SQL Injection.
hope this will help you.