By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,484 Members | 1,764 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,484 IT Pros & Developers. It's quick & easy.

Insert/append values from another table?

P: n/a
Jan
I have a table with autoincrement unique ID plus name (required not to
be blank) and other fields.

I have a list of names in another table and would like to do insert to
the name field of the other table. How do I do it?

I get error messages when trying different approaches. In the end, I
removed the unique key/autoincrement, inserted and ID field in the
source and then did copy&append records in the edit menu and changed it
all back. This is very tedious approach.

Apr 28 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You can't insert into an AutoNumber column (field) when there are values
in that column in other rows (records). The only time you can insert
values into an AutoNumber column is when the table is empty. For tables
with existing data you have to do something like this:

INSERT INTO table_name (name_column)
SELECT name_column
FROM other_table
WHERE <criteria>

The AutoNumber column will automatically add an incremented number for
each new row added to the table.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRFJpeYechKqOuFEgEQJUNwCfbjxCs/1y4+SAnnSnFsCRl22yphwAoJki
TStJMHTrdP3BDFsLqX8MbAKq
=g8jG
-----END PGP SIGNATURE-----
Jan wrote:
I have a table with autoincrement unique ID plus name (required not to
be blank) and other fields.

I have a list of names in another table and would like to do insert to
the name field of the other table. How do I do it?

I get error messages when trying different approaches. In the end, I
removed the unique key/autoincrement, inserted and ID field in the
source and then did copy&append records in the edit menu and changed it
all back. This is very tedious approach.

Apr 28 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.