SQLTeam.com | Weblogs | Forums

Table merged


#1

Hi,
I have 2 tables on different database. it has different field number and both of them already have data stored . I need to merge them so the field of the destination table has same number (only the field without data).
Does anyone can help how?

thx,

Joe


#2

please post the schema of each tables like the following?

create table table1(id int , PurchaseDate datetime)
create table table2(id int , OrderNumber varchar(25), PurchaseDate datetime)


#3

Table A on DB 1
Column Name Data type
ID Varchar(20)
Name Varchar(30)
Address varchar(50)
City varchar(20)

Table B on DB2
Column Name Data Type
ID Varchar(20)
Name Varchar(30)

I want to import the table structure into table B on DB2

thx


#4

Is this a one time "merge"? Or continuous?


#5

one time only..

thx


#6
create table TableA(
ID Varchar(20),
Name Varchar(30),
Address varchar(50),
City varchar(20)
)


--TableB on DB2
create table TableB(
ID Varchar(20),
Name Varchar(30)
)

select * from TableB

alter table TableB add Address varchar(50);
alter table TableB add City varchar(20)


select * from TableB

is this what you are asking for ?