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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:48:54+00:00 2026-06-05T08:48:54+00:00

I am currently optimizing a stored procedure, because it times out due to amount

  • 0

I am currently optimizing a stored procedure, because it times out due to amount of calculations and entries present.

However, I am unsure about a situation. Is it best to use 8 temp tables (which draw their information from other data in the database) or to just put the data from the database into various variables and access them?

Which would give the best performance to fix the timeout issue?

  • 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-06-05T08:48:56+00:00Added an answer on June 5, 2026 at 8:48 am

    Depends on how many entries you have in the “temp” tables.

    • a real temp table #temp can have indices defined on it, it will be analyzed by SQL Server for its number of rows etc. and it does take part in transactions, e.g. you can insert rows and then rollback and those rows will “disappear” from your temp tabl

    • a table variable @temp will always be considered by SQL Server to have exactly one row – that’s not a problem if you have just a handful of rows in there. But if you need to store hundreds of rows, this assumption by the SQL Server query optimizer can lead to highly inefficient query plans. Also: table variables do not participate in transactions – that can be a good thing – or a bad one – depending on your environment

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

Sidebar

Related Questions

I'm currently developing a stored procedure for a complex search in a big database.
I making an app and im currently optimizing it to Samsung Galaxy Tab. I
Currently playing about with KnockoutJS. Just trying to update an observable array from a
I am currently optimizing a PHP application and found one function being called around
I'm currently using mysql w/ PHP because that's what I learned and haven't ever
Currently I'm using ContentProvider in my application. Because of layers and no actual need
I'm currently optimizing and maintaining a Perl script used to analyze two CSV files
I'm currently optimizing my web site. I'm using a simple credit system that gives
I'm currently optimizing my iOS app for the new iPad . Unfortunately by adding
My Flex web application is almost ready for launch. I'm currently optimizing as much

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.