This content has been marked as final. Show 3 replies
Stored procedures are pre-compiled so they will run faster. You can also put more than one query into a stored procedure which might save you some work.
Stored Procedures are definitely recommended for anything other than very simple applications. If you have complex business rules that apply to your data, if you need to parse out data before or after it goes into the db or as it comes out, or you need to insert the same data into multiple tables... stored procedures are a terrific way to do these because, as your friend said, it takes the load off the web server. Plus, database servers are better suited to do things like manipulate data than CF is... it'll process it faster.
For smaller, simpler apps, I'd leave it up to you. Learning how to write and work with them is a good thing either way, but simpler queries can run very fast through CF if you use things like the Blockfactor attribute and use the cfqueryparam tags.
Even though there's a learning curve, it's not a very steep one to get the basics of stored procedures down. You'll find that designing your complex applications will be significantly easier. You wont have to account for the business rules in your application and that will probably reduce the complexity of both your model and controller layers of data. Plus... having something extra on your resume never hurts ;-)
Thanks Joe & Dan...
My CMS is quite complicated and the shop element with stock control etc..... definetly could benefit from using stored procs then.