?
Solved

Sql server temp table

Posted on 2011-10-22
6
Medium Priority
?
238 Views
Last Modified: 2012-05-12
Hi Expert,

select * into tmpBusLine from BusinessLine

Is tmpBusLine a temp table? What is different between it with #tmpBusLine and what its scope?

Thanks in advance.
0
Comment
Question by:dshi15
6 Comments
 
LVL 39

Accepted Solution

by:
Aaron Tomosky earned 400 total points
ID: 37011287
#tmptablename will be automatically deleted at the end of the script
0
 
LVL 1

Author Comment

by:dshi15
ID: 37011295
you mean tmpBusLine is not temptable?
0
 
LVL 1

Author Comment

by:dshi15
ID: 37011300
I should say 'you mean tmpBusLine is not  temporary table?'
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 37011307
tmpBusLine - physical table
@tmpBusLine - table variable
#tmpBusLine - temporary table which can be accessed in the query window. When you close the window, the table will be destroyed. Tis table resides in session of sql server
0
 
LVL 93

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 200 total points
ID: 37011312
In your example, tmpBusLine is NOT a temporary table.

To make it a true temp table, you would have to use #tmpBusLine or ##tmpBusLine (the ## indicates global scope).
0
 
LVL 23

Assisted Solution

by:Rajkumar Gs
Rajkumar Gs earned 400 total points
ID: 37011316
This article would make you more clearer
http://www.sqlteam.com/article/temporary-tables

Raj
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
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 summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Screencast - Getting to Know the Pipeline

839 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