dbo.backend_CIUU

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Assembly

Parameters

1
Name Data Type Length Description
@tipo varchar 3

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO

CREATE OR ALTER PROCEDURE dbo.backend_CIUU
@tipo varchar(3)

AS
BEGIN
    SET NOCOUNT ON;
 if (@tipo = 'R') 
 begin
  select cod_ramo, descripcion as ramo, right('000000'+convert(varchar,cod_subramo),6) as cod_subramo, descripcion, descripcion_2
    from ramos
      where tipo_ramo = 'R' 
     and cod_ramo > 100 
     order by cod_ramo    
 end
 else
 begin
  select a.cod_ramo, b.descripcion as ramo, 
         right('000000'+convert(varchar,a.cod_subramo),6) as cod_subramo, a.descripcion, a.descripcion_2
    from ramos a
    left join ramos b on b.cod_ramo = a.cod_ramo and b.tipo_ramo = 'R' 
      where a.tipo_ramo = 'S' 
     and a.formulario = @tipo 
     order by a.cod_subramo
 end 
END

GO

Depends On

1

Used By

No items found