• Hi ,

     

    I ran that whole query from

    CREATE Table SpaceUsedByObject   to  ... UPDATE SpaceUsedByObject
    part.
    I have sql server 2000 version Enterprise Edition and service packs 3a and ms03-031.:
     
    I got error: 
    Server: Msg 512, Level 16, State 1, Line 42
    Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
    The statement has been terminated.
    Server: Msg 512, Level 16, State 1, Line 51
    Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
    The statement has been terminated.
     
    when I double click the error , it is pointing to this line in bold:
    UPDATE SpaceUsedByObject
    SET IndexSpaceUsed = TotalSpaceUsed - (SELECT DataSpaceUsed
                    FROM #SpaceUsedByObjectForDpage S1
                    WHERE S1.ObjName=SpaceUsedByObject.ObjName
                    AND SpaceUsedByObject.IndexSpaceUsed IS NULL
                )
     WHERE IndexSpaceUsed IS NULL 
     
    Did you get an error ?