Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Putting results from UNION into another table

Author  Topic 

cronincoder
Yak Posting Veteran

56 Posts

Posted - 2006-02-10 : 13:14:09
I am merging a temporary table with another table using UNION. I would like to put those results into another table, but am unsure where to put the INTO.


select id
from table 1

UNION

select *
from temptable


Where would the INTO or INSERT INTO go in this situation to put the results of this union into another table?

Example:

select id
from table 1

UNION

select *
from temptable
INTO anotherTable




thank you

Kristen
Test

22859 Posts

Posted - 2006-02-10 : 13:40:41
I think you need to do:

select id
INTO anotherTable
from table 1
UNION
select *
from temptable
INTO anotherTable

Kristen
Go to Top of Page

cronincoder
Yak Posting Veteran

56 Posts

Posted - 2006-02-10 : 14:02:56
perfect...thank you kristen
Go to Top of Page
   

- Advertisement -