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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:06:08+00:00 2026-05-18T02:06:08+00:00

whats the difference between the two types of temp tables @tmp vs #tmp in

  • 0

whats the difference between the two types of temp tables @tmp vs #tmp in SQL 2005?
and are their other types i am unaware of?

thanks

  • 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-05-18T02:06:08+00:00Added an answer on May 18, 2026 at 2:06 am

    #tmp is a temp table and acts like a real table mostly. It can have indexes, can have statistics, participates in transactions, optimiser will work out correct row estimates

    @tmp is a table variable. No indexes, no statistics, not transaction aware, optimiser always assumes exactly 1 row

    Otherwise, they are both scoped (slightly different), in memory/cache but context is tempdb though, will spill to disk if too big etc

    Edit:

    About keys on table variables. They make no difference. There are no stats and one row is assumed. It will change a table scan to a clustered index scan which is the same. Check any query plan and estimated rows.

    Also, just read this Read What a difference a temp table makes over a table variable

    The first thing that I did was put a primary key on the @ComputersToProcess table variable. That turned the table scan into a Clustered Index Scan, but didn’t do anything for performance.

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

Sidebar

Related Questions

what is the difference between those two types of arrays, thanks in advance for
a=[1,2,3] b=[4,5,6] c=[] d=[] Whats the difference between these two statements? c[:]=a d=b[:] But
What is the difference between these two types of pointers? As far as I
What is the difference between these two file types. I see that my C++
What is the difference between the two? Invoke((MethodInvoker) delegate { checkedListBox1.Items.RemoveAt(i); checkedListBox1.Items.Insert(i, temp +
What is the difference between these two types of running a JavaScript function? (function()
What is the difference between the following two parameter types? The first accepts a
Can someone shed some light on what the difference is between these two types
I'm a newbie in Generic and my question is: what difference between two functions:
What's the difference between the two, when should RegisterAttached() be used instead of .Register()?

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.