Multiple Queries Using a Union - Need to Insert Final Result Set into a Temp Table

I have a query with multiple unions (needed this because of the data inputs).  I now need to insert the entire result set into a temp table...how do I accomplish this?  Thank You

Select a, b, c, from a where a = x
union
Select a, b, c, from a where a = b
union
Select a, b, c, from a where a = c

into #a

select * from a

Glen_DAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Glen_DAuthor Commented:
Here's a better description of the query - actual code:

select b.Categories, a.*
from dbo.tbl_2510v1 a, dbo.tbl_Def b
where (a.FacilityAsset like '%Acoustics Testing%' or
          a.Description like '%Acoustics Testing%' or
          a.Requirement like '%Acoustics Testing%')
and b.categories like '%Acoustics Testing%'
union
select b.Categories, a.*
from dbo.tbl_2510v1 a, dbo.tbl_Def b
where (a.FacilityAsset like '%Avionics%' or
          a.Description like '%Avionics%' or
          a.Requirement like '%Avionics%')
and b.categories like '%Avionics%'
union
etc
etc
etc
0
ava23Commented:
SELECT * INTO #A FROM
(Select a, b, c, from a where a = x
union
Select a, b, c, from a where a = b
union
Select a, b, c, from a where a = c
)TMP

select * from #A
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Glen_DAuthor Commented:
Thank You
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.