IF EXISTS(SELECT * FROM sysobjects O, sysusers U
          WHERE
            o.name = 'NMUSUARIO' and
            type = 'P'                     and
            u.uid = o.uid                   and
            u.name = USER)
  DROP PROCEDURE NMUSUARIO
  GO
CREATE PROCEDURE NMUSUARIO @P_NMUSUARIO VARCHAR(40) OUTPUT
AS
   SELECT @P_NMUSUARIO = MAX(NMOPERADOR) 
   FROM SQLWEBTUNNING SQ, OPERADOR OP
   WHERE
      SQ.DSREMOTEOPER = OP.CDOPERADOR AND
      SQ.NRAUDSID     = @@SPID;    
GO

-- VERSAO --
EXEC ATUVEROBJ 'NMUSUARIO','4.09.067';
GO

