
Newbie help Please - best way to copy a row
Sorry I wasn't quite clear on this.
In table a there is a member_id column which is the key field,
autoincrement.
table a_temp columns are a duplicate of the table a columns, except
the
member_id field is called temp_id. There is no member_id column in the
a_temp table.
this code:
INSERT INTO a (M_NAME, M_PASSWORD, M_EMAIL, M_HIDE_EMAIL, M_DATE,
M_COUNTRY, M_SIG, M_YAHOO, M_ICQ, M_AIM, M_POSTS, M_HOMEPAGE,
M_LASTHEREDATE, M_STATUS, M_LAST_IP, M_IP, M_FIRSTNAME, M_LASTNAME,
M_CITY,
M_STATE, M_PHOTO_URL, M_LINK1, M_LINK2, M_AGE, M_MARSTATUS, M_SEX,
M_OCCUPATION, M_BIO, M_HOBBIES, M_LNEWS, M_QUOTE)
SELECT (M_NAME, M_PASSWORD, M_EMAIL, M_HIDE_EMAIL, M_DATE, M_COUNTRY,
M_SIG, M_YAHOO, M_ICQ, M_AIM, M_POSTS, M_HOMEPAGE, M_LASTHEREDATE,
M_STATUS, M_LAST_IP, M_IP, M_FIRSTNAME, M_LASTNAME, M_CITY, M_STATE,
M_PHOTO_URL, M_LINK1, M_LINK2, M_AGE, M_MARSTATUS, M_SEX,
M_OCCUPATION,
M_BIO, M_HOBBIES, M_LNEWS, M_QUOTE)
FROM a_temp
WHERE TEMP_ID = '2'
generates the error [Microsoft][ODBC SQL Server Driver][SQL
Server]Line 1"
Incorrect syntax near ','.
Sorry for the delay. My ISP(ameritech, not to name names) only
supports newsgroup messaging during certain phases of the moon)
Thanks
Quote:
> Please provide DDL (CREATE TABLE), example data (INSERT INTO) and your
> expected result so we know what you are trying to do and so we can help you
> better.
> Michael MacGregor
> Database Architect
> SalesDriver