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
--exec [proceso_visibles_cheques]
CREATE OR ALTER PROCEDURE dbo.proceso_visibles_cheques
AS
BEGIN
SET NOCOUNT ON;
declare @id integer
declare @cuit_firmante varchar(20)
declare @cuit_relacionado varchar(20)
declare @nro integer
DECLARE bn CURSOR FOR
select top 1000 id, cuit_firmante, nro_cheque, cuit_relacionado
from Cheq_rech_visibles1
where procesado is null
OPEN bn
Fetch next from bn INTO @id, @cuit_firmante, @nro, @cuit_relacionado
WHILE (@@FETCH_STATUS <> -1 )
BEGIN
update ChequesBCRA
set visible = 1,
MODIFIED = '2000-01-01'
where cuit_firmante = @cuit_firmante
and nro_cheque = @nro
and isnull(Cuit_relacionado,'') = isnull(@cuit_relacionado,'')
update Cheq_rech_visibles1 set procesado = 'S' where id = @id
Fetch next from bn INTO @id, @cuit_firmante, @nro, @cuit_relacionado
END
CLOSE bn
DEALLOCATE bn
END
GO
GO
--exec [proceso_visibles_cheques]
CREATE OR ALTER PROCEDURE dbo.proceso_visibles_cheques
AS
BEGIN
SET NOCOUNT ON;
declare @id integer
declare @cuit_firmante varchar(20)
declare @cuit_relacionado varchar(20)
declare @nro integer
DECLARE bn CURSOR FOR
select top 1000 id, cuit_firmante, nro_cheque, cuit_relacionado
from Cheq_rech_visibles1
where procesado is null
OPEN bn
Fetch next from bn INTO @id, @cuit_firmante, @nro, @cuit_relacionado
WHILE (@@FETCH_STATUS <> -1 )
BEGIN
update ChequesBCRA
set visible = 1,
MODIFIED = '2000-01-01'
where cuit_firmante = @cuit_firmante
and nro_cheque = @nro
and isnull(Cuit_relacionado,'') = isnull(@cuit_relacionado,'')
update Cheq_rech_visibles1 set procesado = 'S' where id = @id
Fetch next from bn INTO @id, @cuit_firmante, @nro, @cuit_relacionado
END
CLOSE bn
DEALLOCATE bn
END
GO
Depends On
1Used By
No items found