/****** Object:  StoredProcedure [dbo].[P_EST_PROD_CPL_LOTE_CORRIGE_DATAS]    Script Date: 02/11/2014 18:34:05 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[P_EST_PROD_CPL_LOTE_CORRIGE_DATAS]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[P_EST_PROD_CPL_LOTE_CORRIGE_DATAS]
GO
CREATE PROCEDURE P_EST_PROD_CPL_LOTE_CORRIGE_DATAS AS
UPDATE EST_PROD_CPL_LOTE
SET DT_VALID = convert(char(10),getdate()+120,112)
WHERE YEAR(DT_VALID) < 2000 or DT_VALID is null

UPDATE EST_PROD_CPL_LOTE
SET DT_FABR = convert(char(10),getdate()-120,112)
WHERE YEAR(DT_FABR) < 2000 or DT_FABR is null
