By the way, if you want to mess with it, here's the code for sp_resetstatus from a SQL 7 box (taken from sp_helptext sp_resetstatus). Use at your own risk!CREATE PROCEDURE sp_resetstatus -- 1995/11/30 14:12 #12092 @DBName sysnameasSet nocount onDeclare @msg nvarchar(280) ,@RetCode integer ,@_error integer ,@_rowcount integer ,@int1 integer ,@bitSuspect integer ,@mode integer ,@status integerSelect @RetCode = 0 -- 0=no_problem, 1=some_problem--------------------- Restrict to SA -------------------------IF suser_id() <> 1 begin RaisError(15003,-1,-1,'sysadmin') Select @RetCode = 1 GOTO LABEL_86BYEBYE end------------------ Get SuspectBit id value ------------------SELECT @bitSuspect = min(number) from master..spt_values where type = 'D ' and name = 'not recovered' -- 256, Suspect---------------------- Forbid active txn ------------------------ (Prior spt_values Sel trips SET implicit_transactions!)IF @@trancount > 0 begin RaisError(15002,-1,-1,'sp_resetstatus') Select @RetCode = 1 GOTO LABEL_86BYEBYE end--------------- Obtain/Report pre-Update values --------------------SELECT @mode = min(mode) ,@status = min(status) from master..sysdatabases where name = @DBNameIF @@error <> 0 OR @status IS Null begin RaisError(15010,-1,-1,@DBName) Select @RetCode = 1 GOTO LABEL_86BYEBYE endSelect @int1 = @status & @bitSuspectRaiserror(15052,-1,-1 ,@DBName ,@mode ,@status ,@int1)--------------------- Update sysdatabases row ---------------------BEGIN TRANSACTIONUPDATE master..sysdatabases set mode = 0 ,status = status & (~ @bitSuspect) where name = @DBName and (mode <> 0 OR status & @bitSuspect > 0 )Select @_error = @@error ,@_rowcount = @@rowcountIF @_error <> 0 begin ROLLBACK TRANSACTION RaisError(15055,-1,-1) Select @RetCode = 1 GOTO LABEL_86BYEBYE endCOMMIT TRANSACTION-------- Report the resultsIF @_rowcount = 0 begin Raiserror(15056,-1,-1) endELSE begin Raiserror(15073,-1,-1, @DBName,@bitSuspect) Raiserror(15074,-1,-1) endLABEL_86BYEBYE:RETURN @RetCode
-------------------It's a SQL thing...Edited by - AjarnMark on 11/30/2001 19:57:30