Advantage of Stored Procedure?

  • Is there any real advantage to using a stored procedure other than that it is modular / encapsulated?

  • Numerous.

    Stored Cache in engine.

    Security allowed execute only on proc and no direct data access.

    Multiple call reusability.

    (Depending on tasks) Can do multi-step processes that a view cannot.

    Helps to protect against SQL injection.

    ... and the list goes on.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • In addition to Craig's....

    It makes database changes and tuning so much easier. From a DBA's perspective, you need to maintain the ability to make DB schema changes for performance, data integrity, etc. without worrying about breaking application code. Having your DB access code all embedded in stored procedures allows you to quickly figure out the scope of a schema change. This is extremely difficult to do when all of the data access code is within the application code. Simple schema changes can result in having to change and redeploy application code....not good.

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • Thank you.

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

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