• I'm not sure you should do this as it might give you incorrect results if there are several people with same name and DOB (chances are low, but it could happen).

    If you proceed with this, you could use this sample code to guide you.

    DECLARE @test-2 TABLE(

    ID int,

    lastName varchar(20),

    firstName varchar(20),

    DOB date,

    SSNvarchar(20))

    INSERT @test-2

    VALUES

    (1, 'Doe', 'John', '19670101', '111-22-3333'),

    (2, 'Doe', 'John', '19670101', NULL),

    (3, 'Doe', 'John', '19670101', '111-22-3333')

    UPDATE t1 SET

    SSN = t2.SSN

    FROM @test-2 t1

    JOIN @test-2 t2 ON t1.lastName = t2.lastName

    AND t1.firstName = t2.firstName

    AND t1.DOB = t2.DOB

    AND t2.SSN IS NOT NULL

    WHERE t1.SSN IS NULL

    SELECT * FROM @test-2

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2