Avatar of blossompark
blossompark
Flag for Ireland asked on

creating a permanent table from the results of a select statement in sql server 2016

Hi,
I have a SELECT statement that returns  a result set, I now want to create a table from the results set.
I ththought
SELECT INTO newtable
FROM
(
Select statement
)
would work but it doesnt...
any help appreciated, thanks
Microsoft SQL ServerSQL

Avatar of undefined
Last Comment
blossompark

8/22/2022 - Mon
SOLUTION
Nitin Sontakke

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
blossompark

ASKER
Hi Nithin, can the sourceTable be a SELECT statement? Ive tried this but gets an error
ASKER CERTIFIED SOLUTION
Qlemo

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Nitin Sontakke

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
blossompark

ASKER
Thanks for your assistance, I had left out the alias, that was the issue
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck