• vivek-459197 (11/7/2009)


    Hi Florian,

    Resolve the issue replacing -

    DECLARE @select VARCHAR(MAX)

    With

    DECLARE @select VARCHAR(8000)

    &

    changing this query

    SELECT @object_id = object_id, @schema_id = schema_id

    FROM sys.tables

    WHERE object_id = OBJECT_ID(@table_name)

    to

    SELECT @object_id = id, @schema_id = schema_id

    FROM sysobjects

    WHERE id = OBJECT_ID(@table_name) and type = 'U'

    But still getting error at schema_id

    Please help on this.

    Thanks

    Vivek

    It would be real handy if you'd post the actual error you're getting...

    What do you get when you execute the following?

    SELECT * FROM dbo.SysObjects

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)