Forum Moderators: open

Message Too Old, No Replies

Stored Procedure General Question

         

andrewsmd

2:30 pm on May 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What benefits do you receive from using stored procedures vs. keeping your business logic within your application. In general I try to keep all of my logic on the code end and out of the database. I am working with a system someone else developed now and this person used stored procedures along with their server side code. This is making it extremely difficult for me to see what does what. What is the benefit of using stored procedures? Thanks,

Demaestro

3:08 pm on May 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If done properly you should see better performance of the operations as far as execution times.

There is of course security as well.

I find the use of triggers and functions really helpful for forcing data integrity. Cascading updates especially.

andrewsmd

3:30 pm on May 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have always enforced data integrity via the server side. Is that bad practice?

LifeinAsia

3:59 pm on May 28, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Definitely better performance. And some things I assume can only be done through a stored procedure (never tried using temp tables through an application-side DB call, so I don't know if it can be done or not.)

Our DB server has more horsepower and memory than the application server, so we try to push as much heavy lifting onto the DB server as possible.