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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 A simple Insert Question

Author  Topic 

CLages
Posting Yak Master

116 Posts

Posted - 2005-06-08 : 17:03:50
Hi, may be i am blind because i can not see may mistake.


I have 3 Tables, EMPRESA, DEPOSITO and EMPDEP

EMPRESA
column emp_codigo (smallint)
01
05
09
..

DEPOSITO
column dep_codigo (char(03))
ABC
XXX
005
...

I want to inser all rows from DEPOSITO to each Row in EMPRESA
then EMPDEP should be

ed_empresa ed_deposito
01 ABC
01 XXX
01 005

05 ABC
05 XXX
05 005

09 ABC
09 XXX
09 005


tks
Clages

CLages
Posting Yak Master

116 Posts

Posted - 2005-06-08 : 17:07:16
Sorry, i found my mistake
i solve using

insert into EMPDEP
select emp_codigo, dep_codigo from empresa , deposito
order by emp_codigo


tks
anyway

C. Lages
Go to Top of Page
   

- Advertisement -