Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Update table with auto number field

0 views
Skip to first unread message

fix

unread,
Jan 31, 2002, 6:07:51 AM1/31/02
to
I got a discussion forum system written by ASP, using Access as backend
database.
There is two table, "db_topic" and "db_message",
in "db_topic" there is an "id" auto number field,
in "db_message", there is an "id" auto number field, and a "topic_id" field,
reference to the topic's "id" field.
(There are still other fields, but are unrelated in this case.)

I want to combine two database, just name them as "A" and "B",
my plan is to copy everything out of "B" and put them back into "A",
but I know it is not possible to keep the auto number fields unchange.
It is not a big problem to change the "id" fields, but my headache comes
from the "topic_id" field of "db_message".
Is there any method to update them easily rather than looping through and
doing manual "SELECT"s, "INSERT"s and "UPDATE"s?
--

Harinatha Reddy Gorla

unread,
Jan 31, 2002, 6:16:56 AM1/31/02
to
HI
You can try with SELECT..INTO:
SELECT A.*,B.* into tblNEW
FROM Table A INNER JOIN Table B ON A.ID=B.ID

Using above example , you can create new table.

Harinatha Reddy Gorla
Software Engineer
Smart Software Technologies,
Hyderabad, India


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

fix

unread,
Jan 31, 2002, 9:34:22 AM1/31/02
to
But I have two tables with same structure in each database, and I want to
combine them(database A and B), not to combine the table.
Sorry for not making it clear.....

--

"Harinatha Reddy Gorla" <anon...@devdex.com> ?????
news:#yl2LjkqBHA.2324@tkmsftngp03...

0 new messages