Description
Properties
| Name | Value |
|---|---|
| ANSI Nulls ON | True |
| Quoted Identifier ON | True |
| Encrypted | False |
| Execute As | |
| Assembly |
Parameters
2| Name | Data Type | Length | Description |
|---|---|---|---|
| @Num | varchar | 8 | |
| @Cuit | varchar | 11 |
SQL Script
Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE OR ALTER PROCEDURE dbo.IV_ARREGLA_CUIT
@Num varchar(8),
@Cuit varchar(11)
AS
BEGIN
SET NOCOUNT ON;
declare @IDP2 int = 0
declare @IDP int = 0
declare @Iden varchar(4) = ''
declare @Iden2 varchar(4) = ''
/*
select * from padrones where identificacion=@Cuit
select * from informes where numero = '20183381203'
select * from IV_busquedas where numero = '20183381203'
select * from padrones where identificacion = '20183381203'
*/
select @IDP=id_padron,@Iden=identificador from padrones where identificacion=@Cuit
select @IDP2=id_padron,@Iden2=identificador from padrones where identificacion=@Num
update IV_busquedas set numero = @Cuit,id_padron=@IDP,identificador=@Iden where numero = @Num
update informes set numero = @Cuit,identificador=@Iden where numero = @Num
update padrones set habilitado = 0 where id_padron = @IDP2
END
GO
GO
CREATE OR ALTER PROCEDURE dbo.IV_ARREGLA_CUIT
@Num varchar(8),
@Cuit varchar(11)
AS
BEGIN
SET NOCOUNT ON;
declare @IDP2 int = 0
declare @IDP int = 0
declare @Iden varchar(4) = ''
declare @Iden2 varchar(4) = ''
/*
select * from padrones where identificacion=@Cuit
select * from informes where numero = '20183381203'
select * from IV_busquedas where numero = '20183381203'
select * from padrones where identificacion = '20183381203'
*/
select @IDP=id_padron,@Iden=identificador from padrones where identificacion=@Cuit
select @IDP2=id_padron,@Iden2=identificador from padrones where identificacion=@Num
update IV_busquedas set numero = @Cuit,id_padron=@IDP,identificador=@Iden where numero = @Num
update informes set numero = @Cuit,identificador=@Iden where numero = @Num
update padrones set habilitado = 0 where id_padron = @IDP2
END
GO
Depends On
1Used By
No items found