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
 General SQL Server Forums
 New to SQL Server Programming
 Multiple Select * Into 's (is this correct?)

Author  Topic 

fuzzyip
Starting Member

35 Posts

Posted - 2008-07-18 : 01:23:10
begin
select *
into ANInv
from ANMaxMin
end

begin
select *
into ANSold
from carssoldv3_1
end

begin
select *
into ANUnsold
from carsunsoldv3_1
end

begin
select *
into ANUnsoldbyday
from carsunsoldbydayv2_1
end






I typed this into sqlserver and its still executing, its been over 15 minutes.

Basically I'm trying to create these 4 tables based off these 4 views.

I could run them 4 separately but I'm trying to save some time and hassle, is the above correct syntax to do all that within 1 query???

Thank you, much appreciated

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2008-07-18 : 02:02:50
Thats the way, I wood try:
select *
into ANInv
from ANMaxMin
go
select *
into ANSold
from carssoldv3_1
go
select *
into ANUnsold
from carsunsoldv3_1
go
select *
into ANUnsoldbyday
from carsunsoldbydayv2_1

Greetings
Webfred

There are 10 types of people in the world: Those who understand binary, and those who don't...
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-18 : 04:16:44
quote:
Originally posted by fuzzyip

begin
select *
into ANInv
from ANMaxMin
end

begin
select *
into ANSold
from carssoldv3_1
end

begin
select *
into ANUnsold
from carsunsoldv3_1
end

begin
select *
into ANUnsoldbyday
from carsunsoldbydayv2_1
end






I typed this into sqlserver and its still executing, its been over 15 minutes.

Basically I'm trying to create these 4 tables based off these 4 views.

I could run them 4 separately but I'm trying to save some time and hassle, is the above correct syntax to do all that within 1 query???

Thank you, much appreciated


no problem with syntax. how many records are there in each table? also you could replace * with only columns required if you dont want all of them.
Go to Top of Page
   

- Advertisement -