• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 109
  • Last Modified:

Stored Procedures - What's More Efficient?

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
infotechelg
Asked:
infotechelg
1 Solution
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
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
 
infotechelgAuthor Commented:
Thank you, sir!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now