• HI- jerry tks for reply.

    yes the table as the column.

    You can see in the lines of the stored procedure (in read) the line:

    "('ALTER TABLE bulk_provincia add CODIGOMAXIMO INT IDENTITY (' + @maxprov

    + ',1)'"

    this line alters the table, addind the column codigomaximo.

    But then, when i make a select to it (same lines below the creation of the column), the proc raises the error.....

    If i put "GO" between each line, instead of having in the stored proc, it woks fine. It simes like the Alter table does not function without a "GO"

    Can you please help?

    tks,

    Pedro

    P.s - as to the index a allready removeit from the procedure.