dbo.backend_terminos

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Assembly

Parameters

2
Name Data Type Length Description
@p_id_terminos int 4
@p_visible bit 1

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO

CREATE OR ALTER PROCEDURE dbo.backend_terminos
@p_id_terminos int, -- si viene nulo busca los otros dos campos, si viene con valor solo busca por este id.
@p_visible bit

AS
BEGIN
    SET NOCOUNT ON;

 begin
  select terminos_condiciones.id_terminos, 
  terminos_condiciones.texto,
  replace(convert(varchar(255), terminos_condiciones.texto),char(10),'<br>') as mostrar, 
  replace(convert(varchar(max), terminos_condiciones.texto),char(10),'<br>') as texto_formateado, 
  terminos_condiciones.id_plataforma, 
  plataformas.nombre_plataforma, 
  terminos_condiciones.visible as visible,
  estado = case terminos_condiciones.visible
   when 1 then 'ACTIVO'
   when 0 then 'INACTIVO' 
  end
   
  from terminos_condiciones
  left join plataformas on plataformas.id_plataforma = terminos_condiciones.id_plataforma
  
  where (@p_id_terminos is not null and id_terminos = @p_id_terminos) 
     or (terminos_condiciones.visible = @p_visible)
      
       
 end
END

GO

Used By

No items found