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 6537215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:35:25+00:00 2026-05-25T10:35:25+00:00

I read a book on SQLServer 2008. Within this book the author stated that

  • 0

I read a book on SQLServer 2008. Within this book the author stated that although stored procedures are mostly the solution, you should avoid using them all the time.
I know that stored procedures are pre-compiled which as a result makes them run faster than normal commands. Also because they use parameters for passing data, they’re far safer than normal SQL commands in case of SQL injection attacks.
So what I don’t understand is: Why not always use stored procedures?

  • 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-25T10:35:26+00:00Added an answer on May 25, 2026 at 10:35 am

    A good article on the subject

    http://www.codinghorror.com/blog/2004/10/who-needs-stored-procedures-anyways.html

    So I think you should do what you prefer. There is no performance difference (for msot of the query you’ll have to run).

    I’d say go for no stored procedure : stored procedure are a pain in th a.. :

    • no overloading : If you want to add a parameter you’ll have to update all your calls (or create a new SP)

    • no complex type : with dynamic sql you can build all your sql filter like you want depending on your complex objects

    • securiy is not a reason : if your sql query are sql injection proof and your database is not available for everybody, you can handle your data access security policy at the application level (any dba would kill me saying this, but any dev would agree… I guess)

    SP are “pre-compiled” (at the first execution, the database server will find the best execution plan, for SQL server), BUT in our time we can forget about it, the “compilation” time is really little so we don’t have to worry about it. I never saw a case when I thought “OMG the compilation time is my application bottleneck”, most of the time your application bottleneck will be the query itself, so don’t worry about performance when you don’t have to.

    And this “pre-compilation” depends on the parameters you send to the SP (on the first call), so sometimes you can have a lot of performance problem (called “parameter sniffing”) with SPs (see here :http://www.sqlpointers.com/2006/11/parameter-sniffing-stored-procedures.html).

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

Sidebar

Related Questions

Recently I read a book( CleanCode ) in this book, FUNCTION SHOULD DO ONE
I read a book that uses infix, infixr, and infixl in the sample programs.
I want to read a book that systematically introduces dom with live examples. Any
I've read this book section about git branches. I have create a branch called
A few years ago, I read a book that described how you could override
I am creating sql queries and I have read in one book that when
I have been hearing this word Client Side whenever I read book or while
I read this book: Head First Object-Oriented Analysis and Design Now i am looking
I have read the book Restful Web services. In that book it described WADL
For example, I read in book that if we created relationship 1:m, Grails automatically

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.