Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4542632
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:25:07+00:00 2026-05-21T15:25:07+00:00

When I first got into databases I was using SQL Server. I got into

  • 0

When I first got into databases I was using SQL Server. I got into that originally with classic ASP. One of the big things we were told was that you saved a LOT of time in your SQL transactions if you used stored procedures, rather than working with the ASP SQL commands (doing it “in line”, I suppose). So almost everything I ever wanted to do with the database I wrote a stored procedure for, and then called the stored procedure from my code.

Anyway, fast forward several years and I’m now doing all of my work with PHP and MySQL (and a little Python). One thing that I don’t seem to see much of at all is people using stored procedures/functions, so I haven’t really been worrying about it.

However, it occurs to me that I’m just doing it wrong and don’t realize it. Is there a major advantage to using stored functions in MySQL? I’m building a fairly good-sized website that handles a lot of calls to the database. The calls are all done in-line with my PHP code. Would I be better off using stored functions for the calls that I’m making consistently, and then just passing variables to the function from the PHP?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T15:25:07+00:00Added an answer on May 21, 2026 at 3:25 pm

    Well that depends. Stored procedures are a way to handle functional decomposition and can be absolutely essential if you have multiple applications interacting with the same database. The idea of using stored procures for everything was on the ascendancy a couple of years ago and as the world has moved to a service/RAD world they are losing some ground.

    Some of the benefits of stored procedures are

    1. Reuse / This can certainly be accomplished within your code base but it beats the hell out of writing the same query with 10 sub joins 15 times

    2. Security – when sp were the rage sql injection attacks were coming to the for front and one way to reduce your exposure is to offer parameterized sp that sanitize you input automatically for the most case

    3. Documentation by definition on really large databases table layout is not always sufficient to explain what you are storing and why and have SP sometimes gives you and those that come after you what was intended

    4. A defined interface.

    I think that all of these pros can be provided assuming good application design and only make scene to a degree on projects of some scale.

    Some cons

    1. Redundant functionality – I have seen a lot of shops where business and crud logic is spread in the application and business logic is in the database.

    2. Lack of configuration management on SPs — While there are established procedures and tools for code SP management lags far behind.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got some old code on a project I'm taking over. One of my
I've got a multithreaded app using the OmniThreadLibrary . I am misusing the OTL
In trying to implement the repository pattern I've run into a minor problem that
I thought I'd experiment a bit with Scott Guthrie's latest post on code-first dev
As they say on the radio - long time listener first time caller.... Here's
I'm using Ubuntu 10.10, PostgreSQL 9.0 and PostGIS 1.5. I've installed PostGIS 1.5 from:
I've got a fairly extensive data entry task to perform in a PHP application.
I am new to Derby and I noticed that I face similar problems as
I must be missing something pretty basic. I'm working on a legacy project, and
I'm very new to WPF and the EF, and I'm trying to display some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.