dbo.ImportaPadron

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.ImportaPadron 

AS
BEGIN
 -- SET NOCOUNT ON added to prevent extra result sets from
 -- interfering with SELECT statements.
 SET NOCOUNT ON;

    insert into padrones (numero,nombre_persona,tipo_persona,identificador,sexo,identificacion)
 select top 10000 replace(cuit,'-','') as cuit,razon_social as nombre_persona,left(tipo_persona,1) as tipo_persona,'CUIT' AS identificador,null as sexo, replace(cuit,'-','') as identificacion 
 from pad_cuitn
 where replace(cuit,'-','') not in (select numero from padrones)

END

GO

Used By

No items found