| Author |
Topic  |
|
|
kpgraci
Yak Posting Veteran
65 Posts |
Posted - 05/07/2012 : 11:16:14
|
I have a web app that uses web services to read and write to a sql database.
I initially wrote all the queries as stored procedures because I was told that is the most efficient. The queries I use are rater basic, the retrieve one or more records based on parameters, or update a single record.
Later I read that doing a single query one at a time like this that stored procedures offered no real performance benefit. The discussion listed times when it would be beneficial to use stored procedures, and I don;t remember what that was but I did none of those things.
So for simple, call one at a time when the user requests a get or put operation, is there a performance benefit to using stored procedures?
kpg |
|
|
sunitabeck
Flowing Fount of Yak Knowledge
5152 Posts |
Posted - 05/07/2012 : 14:15:37
|
Even if the queries are very simple and performance is not a consideration, I would try to use stored procs at least for two other reasons:
a) security b) maintainability (for example, if you need to change the schema of a table, if you allow ad-hoc queries, you would be in a bind to dig out all the places in client code where they may be referring to the table).
And, performance is NEVER not a consideration, so stored procs would help in that too via plan reuse etc. |
 |
|
| |
Topic  |
|
|
|