• quote:


    I was mistaken. We use this process for two main reasons:

    1. If we have to change NULL to NOT NULL

    2. For SQL Server 6.5 Boxes.

    I overlooked the "ADD" part...


    
    
    CREATE TABLE #Test(
    Id int NULL)

    INSERT #Test DEFAULT VALUES

    UPDATE #Test SET Id = 0
    WHERE Id IS NULL

    ALTER TABLE #Test ALTER COLUMN Id int NOT NULL

    --Jonathan



    --Jonathan