Copying Columns

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

hi I'm trying to do something like this:

  UPDATE newusertable B
  SET B.username = A.username
  WHERE B.userid = A.userid
  FROM oldusertable A

But it's not happening....any ideas? I've looked at insert ..into and create
etc but nothing seems to provide the cross-table check i need to perform to
ensure that the right entry is updated to the right record.

many thanks


Re: Copying Columns

A join should do the job.

UPDATE newusertable AS B, oldusertable AS A
SET B.username = A.username
WHERE B.userid = A.userid

Site Timeline