When to use stored procedures

  • Hello everybody,

    I am a newbie in programming, and after a while i've learnt that stored procedures are great to improve application performance.

    My question is, what is the right situation or condition to use stored procedures?? i am developing an application using visual basic 6.0

    Thank you big times ...

  • Hi,

    The main reason to use SQL Stored procedures is mainly performance,

    First of all, SQL Anywhere's procedure language simply runs faster than the application programming language in use.

    Second, there is less application-to-database communication required when repeated SQL operations are embedded within a procedure that is only called once.

    Third, is that once a procedure or trigger has been loaded and compiled it is kept in virtual memory and can be used concurrently by several applications or recursively by one application.

    Hope it answered your question...

    Y

     

  • Another reason to use stored procedures is that it is more secure. There is no sql statements going back and forth from app to db. I use stored procedure for almost all my business logic also. this way the app can be simpler and db schema changes dont affect the app. all you need to do is change the sp.

  • Comletely agree with all the comments posted above but they did not answer the question of when to use stored procedures.

    The answer is 'All the Time'

  • Hello guys, thanks alot for all the replies, I am learning to use stored procedures all the time now

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply