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
 Transact-SQL (2000)
 Concatenate / Append two result sets

Author  Topic 

liffey
Yak Posting Veteran

58 Posts

Posted - 2006-10-06 : 12:10:44
I need to select names from two different tables and return a single result set.

I can do this by creating a temporary table and:
doing a select from tbl1 into #temptable
doing a select from tbl2 into #temptable

select * from #temptable

Is it possible to achieve the same result without using a temporary table?



-dw

nr
SQLTeam MVY

12543 Posts

Posted - 2006-10-06 : 12:12:15
You can use a union or union all

select name from tbl
union all
select name from tbl2


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

liffey
Yak Posting Veteran

58 Posts

Posted - 2006-10-06 : 14:56:16
Thank you.



-dw
Go to Top of Page
   

- Advertisement -