Open fjtello opened 7 years ago
Declare @srv_name varchar(30)
DECLARE Cursor_Base CURSOR FOR SELECT srv.name FROM sys.servers srv WHERE srv.server_id != 0
Open Cursor_Base
FETCH NEXT FROM Cursor_Base INTO @srv_name
WHILE @@FETCH_STATUS = 0 BEGIN PRINT @srv_name
EXEC master.dbo.sp_dropserver @server=@srv_name, @droplogins='droplogins' FETCH NEXT FROM Cursor_Base INTO @srv_name
END
DECLARE @CursorEstado INT SET @CursorEstado = CURSOR_STATUS('global','Cursor_Base')
print ' @CursorEstado: '+ cast(@CursorEstado as varchar(30));
IF (@CursorEstado <> -3 ) BEGIN IF (@CursorEstado <> -1 ) CLOSE Cursor_Base DEALLOCATE Cursor_Base END
Declare @srv_name varchar(30)
DECLARE Cursor_Base CURSOR FOR SELECT srv.name FROM sys.servers srv WHERE srv.server_id != 0
Open Cursor_Base
FETCH NEXT FROM Cursor_Base INTO @srv_name
WHILE @@FETCH_STATUS = 0 BEGIN PRINT @srv_name
END
DECLARE @CursorEstado INT SET @CursorEstado = CURSOR_STATUS('global','Cursor_Base')
print ' @CursorEstado: '+ cast(@CursorEstado as varchar(30));
IF (@CursorEstado <> -3 ) BEGIN IF (@CursorEstado <> -1 ) CLOSE Cursor_Base DEALLOCATE Cursor_Base END