dbo.sp_garotor

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
CREATE OR ALTER PROCEDURE dbo.sp_garotor
AS
BEGIN
    SET NOCOUNT ON;
 declare @r_id_cendeu int
 DECLARE cendeuc2 CURSOR FOR
  select id_cendeu
    from cendeu
   where fec_inf = '201701' and garotor = o_cptos and garotor != 0    
 OPEN cendeuc2 
  FETCH next from cendeuc2 INTO @r_id_cendeu
 WHILE (@@FETCH_STATUS <> -1 )
  BEGIN
   update cendeu 
      set garotor = 0
     where id_cendeu = @r_id_cendeu
   FETCH next from cendeuc2 INTO @r_id_cendeu
  END
 CLOSE cendeuc2
 DEALLOCATE cendeuc2 
END 

GO

Depends On

1

Used By

No items found