Posted by Gert-Jan Strik on 11/22/05 22:27
You were quite close... Here's an example:
Use Northwind
GO
SELECT OrderID
INTO #t
FROM Orders
UNION
SELECT ProductID
FROM "Order Details"
HTH,
Gert-Jan
Andy Kent wrote:
>
> What's the syntax for combining INTO and UNION clauses?
>
> What I want to do is:
>
> SELECT blah
> INTO newtable
> FROM oldtable1
> WHERE <conditions>
> UNION
> SELECT blah
> INTO newtable
> FROM oldtable2
> WHERE <conditions>
>
> DTS doesn't seem to like my syntax. Where should the INTO(s) really go?
>
> Thanks
>
> Andy
[Back to original message]
|