Solved

Stored Procedures - What's More Efficient?

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

In this article I will describe the Detach & Attach 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.
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.

820 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