Making fields same between tables

J

John

Hi

I have two tables A & B which I need to make same in structure. How can I
via code do the following;

Go through both table structures and,

1. If a table A field is missing in table B then to create it in table B?

2. If a table A field is present in table B but the type is different then
to change table B field type to match table A field type?

Many Thanks

Regards
 
J

John W. Vinson

Hi

I have two tables A & B which I need to make same in structure. How can I
via code do the following;

Go through both table structures and,

1. If a table A field is missing in table B then to create it in table B?

2. If a table A field is present in table B but the type is different then
to change table B field type to match table A field type?

Many Thanks

Regards

It would be fairly difficult to automate this, but... WHY!? do you want two
redundant tables?

Your best bet would be to copy Table A to a new table, selecting the option
"Structure only"; if there is data in Table B already, then run an append
query to populate it.

But I'm really concerned since I cannot imagine *any* good reason for a
database to contain two identically structured tables!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top