• Paul White (11/7/2009[font="Courier New"]Msg 512, Level 16, State 1, Line 17

    Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

    [/font][font="Courier New"]The statement has been terminated.[/font]

    Thanks Paul,

    It should be like

    update a

    set a.MemoStatus = (case when (select distinct 1 from @MemoDetail b where b.employee_id = a.employee_id )=1 then 'Y'else 'N' end)

    from @Employee a