Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2010

    Unanswered: Get one Field from Backup dB, add to another!


    I noticed that I made a small error in a query that resulted in one field of data getting slightly messed up. I need to get the entire column from my backup dB and put it in my heavily edited dB table.

    If I restore, then I will loose unkown amount of changes so I'm hoping to swap fields out! The sort order on everything is unchanged.

    Is there an easy way to do this?

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    import the table from the old db into the current db
    then run and update query
    UPDATE [one big table] SET mycolumn = othertablename.mycolumn
    WHERE othertablename.acolumn = [one big table].acolumn
    providing there is a unique reference that is the same in both tables that should work. that unique reference should replace acolumn.

    the way this works is that you tell the SQL engine to replace the value of mycolumn with t he value form the othertable where there is a match between the a column values. if you need more than one column to identify a row uniquely then
    WHERE othertablename.acolumn = [one big table].acolumn
     AND othertablename.bcolumn = [one big table].bcolumn
     AND othertablename.ccolumn = [one big table].ccolumn
    repalce the mycolumn, othertablename, a column etc with your own table /column names
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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