problem with an insert statement

  • im having a problem with an insert statement. the problem is that the program column is left null even after the query is ran.

    insert into NewReport(program)

    select p.description from program p left join newReport nr on p.programID = nr.programID

    where p.programId = nr.programId

    i can run the sub query and that returns all the data, but when i put the insert into part over it, i am told that all the rows have been affected, but there are no changes to them. they still contain NULL. the datatypes are the same so thats not the problem. any ideas?

  • I Think you want to update the Description [NewReport] from the Progarm master where a matcing ProgramId is matched.

    Update NewReport

    set program =  p.description

    from program p inner join newReport nr on p.programID = nr.programID

    Hope it helps...

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

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