If i try to insert, Iam getting following errors...........
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "KA.ClaimNumber" could not be bound.
Msg 213, Level 16, State 1, Line 1
Insert Error: Column name or number of supplied values does not match table definition.
INSERT Policy_rpt.Ageny
SELECT I.*
,LossDesc = (SELECT MAX(KR.LossDescription) FROM Kaimart_Rpt.ILRCL WHERE ClaimNumber = PR.ClaimNumber)
FROM
Policy_Rpt.ILRCL PR
For updating NULL values for existing records use -
UPDATE
Policy_rpt.Ageny
SET
LossDesc = (SELECT MAX(KR.LossDescription) FROM Kaimart_Rpt.ILRCL WHERE ClaimNumber = PR.ClaimNumber)