Use of EXEC , string and INTO....

I've got a query wich is execute with EXEC.
I need to do this:

@QUERY = select col1 as C1,col2 as C2,col3 as C3 from TABLE


insert into TABLE2 values(C1,C2,C3)

I need in fact to insert in TABLE2 the result of the query.

Thanks for your help .
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.

Aneesh RetnakaranDatabase AdministratorCommented:
Hello bruno_boccara,

insert into TABLE2

Aneesh R

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
try this

@QUERY = insert into TABLE2 (C1,C2,C3)  select col1,col2,col3 from TABLE
bruno_boccaraAuthor Commented:
Thanks you....
Greg BessoIT Solutions EngineerCommented:
ee rlee, just saw your post here and it helped me get something done I was spending all morning on. I hate being a newb with T-SQL, but it's nice to finally get through problems.

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
Microsoft SQL Server

From novice to tech pro — start learning today.