dbo.generar_cartas_empleados_akapol

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: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
CREATE OR ALTER PROCEDURE dbo.generar_cartas_empleados_akapol 
 -- Add the parameters for the stored procedure here
AS
BEGIN
 -- SET NOCOUNT ON added to prevent extra result sets from
 -- interfering with SELECT statements.
 SET NOCOUNT ON;

    -- Insert statements for procedure here


DECLARE @contratista INT

DECLARE lista_contratistas Cursor
FOR

 select distinct contratista from led_docs where tipo_doc = 736 and estado_doc = 'V' and periodo=201612


Open lista_contratistas


Fetch NEXT FROM lista_contratistas INTO @contratista

While (@@FETCH_STATUS <> -1)
BEGIN

 SELECT C.contratista,P.nombre_persona from padrones P JOIN led_contratistas C
 on P.id_padron = C.id_padron where C.contratista = @contratista

 --exec Imperium_Carga_Docs_Empleados_Contratista 201612,9936068,@contratista,'A'

 Fetch NEXT FROM lista_contratistas INTO @contratista
 
END

CLOSE lista_contratistas
DEALLOCATE lista_contratistas

end

GO

Used By

No items found