IF OBJECT_ID('P_PDV_VD_DEV_NCC_AMORTIZAR') IS NOT NULL
	BEGIN
		DROP PROCEDURE P_PDV_VD_DEV_NCC_AMORTIZAR
	END
 
GO 
CREATE PROCEDURE P_PDV_VD_DEV_NCC_AMORTIZAR
AS
UPDATE
	PDV_VD_DEV_NCC
SET 
	STS_NCC=2	
WHERE
	STS_NCC=0
	AND DT_CAD <= GETDATE()-1