performing crud the procedure is best than query?
whch
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Jun 7, 2013, 7:07 AM
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.
Pankaj PandeyPosted Jun 7, 2013, 6:11 AM
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.
Sunny SharmaPosted Jun 7, 2013, 4:56 AM