Solved

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

Posted on 2007-03-31
1
140 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

932 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

10 Experts available now in Live!

Get 1:1 Help Now