Running sp_rename, we are inserting @@error. When the procedure fails it does not provide the error number, instead it provides 0. Running a different SP with @@error produces the right results. Is anyone aware of problems when using sp_rename with @@error?