• Hi Vivek

    The script was made for SQL Server 2005. However, if you change VARCHAR(MAX) to VARCHAR(8000) it might work, if your tables are not too wide.

    In addition change:

    SELECT @object_id = object_id, @schema_id = schema_id

    FROM sys.tables

    WHERE object_id = OBJECT_ID(@table_name)

    ... to something like this:

    SELECT @object_id = id, @schema_id = schema_id

    FROM systables

    WHERE id = OBJECT_ID(@table_name)

    Unfortunately I cannot test it on 2000 at the moment.

    Hope this helps

    Flo