Description
Properties
| Name | Value |
|---|---|
| ANSI Nulls ON | True |
| Quoted Identifier ON | True |
| Encrypted | False |
| Execute As | |
| Assembly |
Parameters
3| Name | Data Type | Length | Description |
|---|---|---|---|
| @p_cuit | varchar | 20 | |
| @p_ids | varchar | 1000 | |
| @p_user_id | int | 4 |
SQL Script
Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
/*
exec backend_procesar_socio '30111111118','22222222222','2023-06', NULL,'AD',NULL,'j','S','0',NULL,NULL, NULL,NULL,'94437923'
*/
-- =============================================
-- Author: <Maria Ines Soria>
-- Create date: <21 Jul 2023>
-- Description: Dado un cuit, y una lista de id_socios,
-- marca como N todos los demas registros del directorio, dejando solo como S, esa lista de ids
-- =============================================
CREATE OR ALTER PROCEDURE dbo.backend_procesar_socio_finalizar
-- Add the parameters for the stored procedure here
@p_cuit varchar(20),
@p_ids varchar(1000),
@p_user_id int = null
AS
BEGIN
SET NOCOUNT ON;
update socios
set c04_ultimo = 'N', modified = getdate(), modified_by = @p_user_id
where c01_cuit = @p_cuit
and visible = 1
and c04_ultimo = 'S'
and isnull(c01_cuit_soc,'') != ''
and id_socios not in (select item from dbo.DelimitedSplit8K(@p_ids, ',') )
select 'ok' as procesado
END
/*
declare @p_ids varchar(1000) = '4168903,4168886'
select * from socios where c01_cuit = '30111111118'
and id_socios in (select item from dbo.DelimitedSplit8K(@p_ids, ',') )
select * from socios where c01_cuit = '30111111118' and c04_ultimo = 'S' and visible = 1 and isnull(c01_cuit_soc,'') != ''
*/
GO
GO
/*
exec backend_procesar_socio '30111111118','22222222222','2023-06', NULL,'AD',NULL,'j','S','0',NULL,NULL, NULL,NULL,'94437923'
*/
-- =============================================
-- Author: <Maria Ines Soria>
-- Create date: <21 Jul 2023>
-- Description: Dado un cuit, y una lista de id_socios,
-- marca como N todos los demas registros del directorio, dejando solo como S, esa lista de ids
-- =============================================
CREATE OR ALTER PROCEDURE dbo.backend_procesar_socio_finalizar
-- Add the parameters for the stored procedure here
@p_cuit varchar(20),
@p_ids varchar(1000),
@p_user_id int = null
AS
BEGIN
SET NOCOUNT ON;
update socios
set c04_ultimo = 'N', modified = getdate(), modified_by = @p_user_id
where c01_cuit = @p_cuit
and visible = 1
and c04_ultimo = 'S'
and isnull(c01_cuit_soc,'') != ''
and id_socios not in (select item from dbo.DelimitedSplit8K(@p_ids, ',') )
select 'ok' as procesado
END
/*
declare @p_ids varchar(1000) = '4168903,4168886'
select * from socios where c01_cuit = '30111111118'
and id_socios in (select item from dbo.DelimitedSplit8K(@p_ids, ',') )
select * from socios where c01_cuit = '30111111118' and c04_ultimo = 'S' and visible = 1 and isnull(c01_cuit_soc,'') != ''
*/
GO
Depends On
2Used By
No items found