• Cursor is a bad word around here... careful.

    That said, I don't think you need a cursor at all.

    CREATE Table #TableA

    (

    ID int IDENTITY(1,1),

    SID INT,

    FNAME varchar(50),

    LNAMEvarchar(50),

    DOB date,

    CITYvarchar(50),

    IsActive bit

    );

    GO

    INSERT INTO #TableA

    VALUES ('245','Smith','John','1/10/1998','Los Angles','0'); -- will be made Active=1.

    INSERT INTO #TableA

    VALUES ('298','Smith','John','1/10/1998','Los Angles','0');

    INSERT INTO #TableA

    VALUES ('987','Smith','John','1/10/1998','Los Angles','0');

    INSERT INTO #TableA

    VALUES ('451','Collins','Albert','3/1/2003','Los Angles','0'); -- will be made Active=1.

    UPDATE #TableA

    SET IsActive = 1

    WHERE [SID] IN

    (SELECT MIN([SID]) AS GoodID

    FROM #TableA

    GROUP BY FName

    , LName

    , DOB

    , City);

    results:

    IDSIDFNAMELNAMEDOBCITYIsActive

    1245SmithJohn1998-01-10Los Angles1 <-- first one of group, so set Active =1

    2298SmithJohn1998-01-10Los Angles0

    3987SmithJohn1998-01-10Los Angles0

    4451CollinsAlbert2003-03-01Los Angles1 <-- first one of group, so set Active =1

    right?