DROP PROC OP_existedocumento
GO
CREATE PROC OP_existedocumento
@DOCTYPEID      UD_DOCTYPEID,    
@NBRDOCUMENT    UD_CORRELATIVOS, 
@SITEID         UD_IDSITE
AS
select count(*) as numero from OP_SALES
		WHERE DOCTYPEID = @DOCTYPEID  and NBRDOCUMENT= @NBRDOCUMENT and  SITEID = @SITEID

GO
--select * from OP_SALES
OP_existedocumento '12',5780000003,'57'
