Solved

Stored Procedures - What's More Efficient?

Posted on 2014-10-14
2
96 Views
Last Modified: 2014-10-14
What is more efficient? 1 stored procedure with 10 different queries, each surrounded by an IF statement, or 10 different stored procedures, each with one query?

Or does it not matter?

SQL Server 2008, by the way.

Thanks!
0
Comment
Question by:infotechelg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 40380989
10 different stored procedures, each with one query, as the Query Optimizer can handle optimizing a single query.

The optimizer won't know what to do with 10 queries surrounded by IF statements.
0
 

Author Closing Comment

by:infotechelg
ID: 40380994
Thank you, sir!
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Are triggers slow? 7 26
Linked Server - SP with Param to VIew 7 29
Can a Trigger trigger a Trigger? 4 45
Classic ASP - Display returned sql output parameter 9 49
This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

742 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question