• the beauty of SQL server is set based operations.

    that means you affect all records, without a loop, as long as they meet a specific criteria.

    IF OBJECT_ID('tempdb.[dbo].[#MyData]') IS NOT NULL

    DROP TABLE [dbo].[#MyData]

    GO

    CREATE TABLE [dbo].[#MyData] (

    [PLANT] VARCHAR(30) NULL,

    [PLANT_DESC] VARCHAR(30) NULL,

    [VENDOR] VARCHAR(30) NULL,

    [VENDOR_NAME] VARCHAR(30) NULL)

    --my initial data

    INSERT INTO #MyData

    SELECT 'NOPE',NULL,'NOPE','NOPE' UNION ALL

    SELECT '7010',NULL,'Coquitlam DC','PR1 -100' UNION ALL

    SELECT 'NOPE',NULL,'NOPE','NOPE' UNION ALL

    SELECT 'NOPE',NULL,'NOPE','NOPE' UNION ALL

    SELECT 'NOPE',NULL,'NOPE','NOPE' UNION ALL

    SELECT 'NOPE',NULL,'NOPE','NOPE' UNION ALL

    SELECT 'NOPE',NULL,'1014435','COCA-COLA NORTH AMERI' UNION ALL

    SELECT 'NOPE',NULL,'1014435','COCA-COLA NORTH AMERI' UNION ALL

    SELECT 'NOPE',NULL,'1014435','COCA-COLA NORTH AMERI'

    SELECT * FROM #MyData

    UPDATE #MyData

    SET PLANT = '7010',

    PLANT_DESC='Coquitlam'

    WHERE VENDOR <> 'NOPE';

    SELECT * FROM #MyData

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!