Solved

Temp Tables # or ## - what is the difference??

Posted on 2007-03-31
1
137 Views
Last Modified: 2010-03-19
What is the difference between temporary tables prefixed with # and ## in sqlserver 2005
0
Comment
Question by:Fraser_Admin
1 Comment
 
LVL 24

Accepted Solution

by:
DBAduck - Ben Miller earned 500 total points
ID: 18830748
# is for connection specific or SCOPE temp tables and ## is a global temp table which means that other scopes have access to the table.

Most of the time you would be dealing with # temp tables because it would be a very interesting thing to have a ## table and have many different connections using it.  But for specific reasons in a specific use, the ## is available in triggers, etc. and for a controlled use, it could be helpful.

Hope that helps.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

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

20 Experts available now in Live!

Get 1:1 Help Now