Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2002
    Location
    Rochester, NY
    Posts
    3

    Unanswered: Importing data from one table to another.

    I have two table with some common fields. I want to import data from one table to another I am using the following SQL query but it is asking the values of each field for every row.

    UPDATE Devices SET Devices.SerialNo = [DiscoveryData].[SerialNumber], Devices.sysDescr = [DiscoveryData].[sysDescr]
    WHERE Devices.MACAddress = [DiscoveryData].[MACAddress]

    MacAddress is unique field in both table but not primary key. Can any one help me.

    Thanks
    Hasan

  2. #2
    Join Date
    Sep 2002
    Location
    Coventry, Warwickshire, UK
    Posts
    74
    Your SQL is wrong. It should be of the form

    UPDATE Table1 INNER JOIN Table2 ON Table1.Field1 = Table2.Field1 SET Table1.Field2 = [Table2].[Field2];
    Roger Hampson
    XI - ecs (UK) Ltd

  3. #3
    Join Date
    Jul 2002
    Location
    Rochester, NY
    Posts
    3
    Originally posted by xiecsuk
    Your SQL is wrong. It should be of the form

    UPDATE Table1 INNER JOIN Table2 ON Table1.Field1 = Table2.Field1 SET Table1.Field2 = [Table2].[Field2];
    Thanks for reply. I have already got the answer from another guy and problem is solved.
    Thanks again
    Hasan

Posting Permissions

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