3 ms·
> I personally hate stored procedures because they invite bad design. The code for them rarely makes it into source control, and even when it does there are oft
by BinaryIdiot 11y ago
> I personally hate stored procedures because they invite bad design. The code for them rarely makes it into source control, and even when it does there are often contextual parts of the schema that aren't included.
That's kinda like saying "I personal hate <Language> because it invites bad design. The code for them rarely makes it into source control". I've never worked on a project that used stored procedures where they were not only checked into source control but provided the full necessary context so any "fresh" dev box could grab them and test them. Half the projects I've worked on with stored procedures even had unit tests!
> Stored procedures, IMO, are a case where DBAs should be pushing their pain down to the software engineering teams.
DBAs are just specialized developers or dev-ops. There is no reason stored procedures shouldn't be written by whoever is writing the application itself.
Personally I loved sprocs! I can fine tune my DB access control so it's impossible to do anything but call a set of sprocs, the sprocs has zero dynamic code so no injection of commands are possible, each db user can access different sprocs and I have this nice separation of concerns where my DB layer is simply a dumb, black box to take in input and return output. The same for all of the other layers of the app.
- BHSPitMonkey 11y ago> I've never worked on a project that used stored procedures where they were not only checked into source control but provided the full necessary context so any "fresh" dev box could grab them and test them. Did you mean to say the opposite of this?
- BinaryIdiot 11y agoBasically. Who knows what upvotes support my screwed up text versus my actual opinion lol. Can't go back and edit. Oh well.