if(@recoveryModel <> 'SIMPLE')
begin
-- Finally changed back
SET @tempTSQL = ('ALTER DATABASE [' + @dbname + '] SET RECOVERY ' + @recoveryModel + ' with no_wait')
EXEC sp_executesql @tempTSQL
if (@@ERROR = 0)
begin
print(' Database [' + @dbname + '] recovery model has been changed back to ''' + @recoveryModel + '''')
end
else
begin
print(' Database [' + @dbname + '] recovery model failed to be changed back to ''' + @recoveryModel + '''')
end
end
end
end
FETCH NEXT FROM dbCursor INTO @dbname
END
CLOSE dbCursor
DEALLOCATE dbCursor
给大家带来的不变深表歉意。