dbo.obtener_cliente

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Assembly

Parameters

1
Name Data Type Length Description
@p_id_usuario int 4

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO

CREATE OR ALTER PROCEDURE dbo.obtener_cliente 
@p_id_usuario int
AS

BEGIN
     SET NOCOUNT ON;
  declare @cliente int
  select @cliente = cliente from clientes_usuarios where clientes_usuarios.user_id = @p_id_usuario --@p_id_usuario
  
  select  iif(estado_cliente != 'A',99,0) as error,
          cp.id_producto,
    cp.activo,
    cp.bloquear_consumo,
    limite_consumo,
    cp.fecha_desde,
    cp.fecha_hasta 
   from clientes 
   
   left join clientes_productos cp 
             on cp.cliente = clientes.cliente 
   
   where clientes.cliente =  @cliente

END

GO

Used By

No items found