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
 dumping data one table to other table

Author  Topic 

ramu143
Yak Posting Veteran

64 Posts

Posted - 2008-05-15 : 04:48:06
i am having one ABC database in this a,b,c are the tables

i need to dump a,b,c tables data into z table in the other xyz database

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2008-05-15 : 04:58:20
[code]
insert into z (<fieldlist>)
select <fieldlist>
from abc.dbo.a
union select <fieldlist>
from abc.dbo.b
union select <fieldlist>
from abc.dbo.c
[/code]
Go to Top of Page

ramu143
Yak Posting Veteran

64 Posts

Posted - 2008-05-15 : 05:05:07
thnks alot
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-15 : 11:01:24
quote:
Originally posted by ramu143

thnks alot


Make sure all the tables are of identical structure.
Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2008-05-19 : 01:37:37
quote:
Originally posted by visakh16

quote:
Originally posted by ramu143

thnks alot


Make sure all the tables are of identical structure.


Why? It doesn't matter if you give fieldnames as long as the fields are the same datatype.
Go to Top of Page
   

- Advertisement -