Update query - changing the primary key

  • Thread starter Thread starter Lisa Mullin
  • Start date Start date
L

Lisa Mullin

I have a table with program names and descriptions. A
number of names and descriptions have been changes, they
are in another temp table. What I want to do is something
like:

update programs {the primary key}
set (program, descriptition) to
select (program_new, descriptition)
from [new programs]
where [new programs].program_was = programs.program

The program table has a cascade relationship to program in
the [training education] table

How can I do this in a query?
 
Try something along the lines of
UPDATE Programs AS P INNER JOIN [new programs] AS N ON
P.program = N.program_was
SET P.program = N.program_new, P.description = N.description

Hope This Helps
Gerald Stanley MCSD
 
Back
Top