Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004
    Posts
    4

    Unanswered: updating a column with a column from another table

    Hi, I am kinda new to this so here it goes:

    table name: USERS
    field names : LName, FName, EmpID


    other table name:PERSONNEL
    field names : (same as USERS)

    The EmpID column in my USERS table is blank (I have 30 records in the table.)

    I would like to update the USERS.EmpID table with the PERSONNEL.EmpID data

    how would I do this or what would the code be?

    sanctos

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    update u set EmpID = p.EmpID
    from USERS u
    inner join PERSONNEL p
    on (u.LName = p.LName and u.FName = p.FName)
    where nullif(u.EmpID, '') is null

  3. #3
    Join Date
    Apr 2004
    Posts
    4

    Wink

    thanks a bunch!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •