dbo.backend_cliente_paises

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Assembly

Parameters

7
Name Data Type Length Description
@accion varchar 50
@cliente int 4
@servicio_contratado int 4
@idReg int 4
@nombrefilial varchar 150
@activo bit 1
@countrycode varchar 2

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
--LT
/*
exec [backend_cliente_paises] 'obtener_cliente_paisesxserv', 7855254,73
exec [backend_cliente_paises] 'obtener_cliente_paises', 2254875
*/

CREATE OR ALTER PROCEDURE dbo.backend_cliente_paises
@accion varchar(50),
@cliente int,
@servicio_contratado int = null,
@idReg int = null,
@nombrefilial varchar(150)=null,
@activo bit = null,
@countrycode varchar(2)=null

AS
BEGIN




    SET NOCOUNT ON;
 if(@accion = 'obtener_cliente_paises')
 begin
 select cliente_paises.servicio_contratado, cliente_paises.country_code,nombre_local,country_name from cliente_paises 
 inner join country on country.country_code = cliente_paises.country_code
 where cliente = @cliente and cliente_paises.activo = 1
 
 end

 if(@accion = 'obtener_cliente_paisesxserv')
 begin
  select cliente_paises.servicio_contratado, cliente_paises.country_code,nombre_local,country_name,id_cliente_pais as idReg,activo as estado from cliente_paises 
  inner join country on country.country_code = cliente_paises.country_code
  where cliente = @cliente 
  /*and cliente_paises.activo = 1*/
  and servicio_contratado in (@servicio_contratado)
 end

 if(@accion = 'update_filial')
 begin
  update cliente_paises set activo = @activo,nombre_local=@nombrefilial where id_cliente_pais = @idReg
 end
 if(@accion = 'insert_filial')
 begin
  insert into cliente_paises (cliente,country_code,activo,nombre_local,created,servicio_contratado)
  values (@cliente,@countrycode,@activo,@nombrefilial,getdate(),@servicio_contratado)
  select @@identity as idReg
 end

END

GO

Used By

No items found