update query

  • hi i have a problem in copying data from one tabel A.column A to table B.column A where Table A.column C = Table B.column C

    Use FuelMaster

    Select machine.FleetNr

    INTO fill.fleetCODE

    FROM machine

    INNER JOIN fill

    ON machine.machinereg = fill.fleetreg

    'Spesified owners name 'fill' does not exist or you do not have permission to use it'

    what can i do

    "fleetCODE" is n new column in tabel "fill" and is empty.

  • UPDATE f

    SET f.fleetCODE = m.FleetNr

    FROM dbo.machine m

    JOIN dbo.fill f

    ON m.machinereg = f.fleetreg

    /Kenneth

  • hey kenneth

    thanx hey.

    worked magic

    morne

  • Morne,

    SELECT INTO is used when the table does NOT exist. SELECT INTO creates the table based on what the SELECT returns.

    -SQLBill

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply