dbo.cron_insur_php

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Assembly

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
-- =============================================
-- Author: Leonel Turchetto
-- Create date: 24/05/2017
-- Description: Proceso de Insur
-- =============================================

CREATE OR ALTER PROCEDURE dbo.cron_insur_php
as
BEGIN
 
    SET NOCOUNT ON;
 select distinct right('00000000000' + RTRIM(ltrim(cuit)), 11) as cuit, RTRIM(ltrim(nombre)) as nombre,detalle
 from [dbo].[insur_procesamiento] 
 where cuit not in (select distinct cuit
  from [dbo].[insur_procesamiento] 
  where detalle not like '999%' and detalle not like '000%')
  
   union all 
  
 select distinct right('00000000000' + RTRIM(ltrim(cuit)), 11) as cuit, RTRIM(ltrim(nombre)) as nombre,detalle
  from [dbo].[insur_procesamiento] 
  where detalle not like '999%' and detalle not like '000%'
 
  order by cuit asc
END

GO

Used By

No items found