Ver Mensaje Individual
  #3  
Antiguo 19-02-2009
Avatar de ContraVeneno
ContraVeneno ContraVeneno is offline
Miembro
 
Registrado: may 2005
Ubicación: Torreón, México
Posts: 4.738
Reputación: 23
ContraVeneno Va por buen camino
yo tengo esto y me funciona muy bien:
Código SQL [-]
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO

-- Exec BuscaCliente 'Juanito'
CREATE PROCEDURE  BuscaCliente
@Cliente varchar(20)
AS
Declare @Result bit

If Exists(Select Cliente From Clientes Where Cliente = @Cliente)
Begin
 select @Result = 1
end else begin
 Select @Result = 0
end

Select @Result as Resultado

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
__________________

Responder Con Cita