?
Solved

How to copy the content of one temp table into another ?

Posted on 2014-04-21
2
Medium Priority
?
234 Views
Last Modified: 2014-04-21
Suppose in Sql server I have two temporary tables,@temp_table_One, and @temp_table_Two

What I need to do is to copy the contents of temp_table_One into temp_table_Two. How would I do this using Sql? (Assume no data exists in temp_table_Two)


Declare @temp_table_One
(
 id int,
 name varchar(30) null,
 address varchar(150)
)

Declare @temp_table_Two
(
 id int,
 name varchar(30) null,
 address varchar(150)
)
0
Comment
Question by:brgdotnet
  • 2
2 Comments
 
LVL 49

Accepted Solution

by:
PortletPaul earned 600 total points
ID: 40013969
select id, name, address
from @temp_table_One
into @temp_table_Two
0
 
LVL 49

Assisted Solution

by:PortletPaul
PortletPaul earned 600 total points
ID: 40013971
you might want to read this:

INTO Clause (Transact-SQL)
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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

829 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