Question Inserting data into exact table from many tables of defferent databases

Alrick

New member
Joined
Dec 22, 2011
Messages
4
Programming Experience
Beginner
Database1 has
A
B
C
x
x
x
x
x
x

and
D
E
F
x
x
x
x
x
x

and then


G
H
I
x
x
x
x
x
x


Database2

A
B
C
y
y
y
y
y
y
and

D
E
F
y
y
y
y
y
y

and
G
H
I
yy
y
y
y
y

how can i write the code VB.net 2008 to get like the following in database3

A
B
C
x
x
x
x
x
x
y
y
y
y
y
y
and
D
E
F
x
x
x
x
x
x
y
y
y
y
y
y
and
G
H
I
x
x
x
x
x
x
y
y
y
y
y
y
 
Note that the two database tables will need to have the same schema,or at least that the query will have to convert to the same schema/produce convertible values.. And the columns will have to have the same names

e.g. suppose I have db tables:

Person
Name, Age, Birthday

Vehicle
RegDate, Manufacturer, Model, EngineSize

And you were to combine them, you'd need queries that output the same type and names of columns:

SELECT Name as SomeStr, Age as SomeNum, Birthday as SomeDate FROM Person
SELECT Manufacturer + '-' + Model as SomeStr, EngineSize as SomeNum, RegData as SomeDate FROM Vehicle


These queries will now fill into the same table in vb.net without causing autocreated columns or conversion errors etc
 
Back
Top