Solved

Stored Procedures - What's More Efficient?

Posted on 2014-10-14
2
81 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
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now