
IF NOT EXISTS (SELECT * FROM SYS.COLUMNS WHERE NAME = 'CD_BCO' AND OBJECT_ID = OBJECT_ID('PG_DEB_DDA_LOTE'))
BEGIN		
	ALTER TABLE PG_DEB_DDA_LOTE ADD CD_BCO int NULL
END

IF NOT EXISTS (SELECT * FROM SYS.COLUMNS WHERE NAME = 'DS_BCO' AND OBJECT_ID = OBJECT_ID('PG_DEB_DDA_LOTE'))
BEGIN		
	ALTER TABLE PG_DEB_DDA_LOTE ADD DS_BCO VARCHAR(50) NULL
END

IF NOT EXISTS (SELECT * FROM SYS.COLUMNS WHERE NAME = 'AG_BCO' AND OBJECT_ID = OBJECT_ID('PG_DEB_DDA_LOTE'))
BEGIN		
	ALTER TABLE PG_DEB_DDA_LOTE ADD AG_BCO VARCHAR(12) NULL
END

IF NOT EXISTS (SELECT * FROM SYS.COLUMNS WHERE NAME = 'DV_AG' AND OBJECT_ID = OBJECT_ID('PG_DEB_DDA_LOTE'))
BEGIN		
	ALTER TABLE PG_DEB_DDA_LOTE ADD DV_AG VARCHAR(2) NULL
END

IF NOT EXISTS (SELECT * FROM SYS.COLUMNS WHERE NAME = 'CNT_BCO' AND OBJECT_ID = OBJECT_ID('PG_DEB_DDA_LOTE'))
BEGIN		
	ALTER TABLE PG_DEB_DDA_LOTE ADD CNT_BCO VARCHAR(12) NULL
END

IF NOT EXISTS (SELECT * FROM SYS.COLUMNS WHERE NAME = 'DV_CONTA' AND OBJECT_ID = OBJECT_ID('PG_DEB_DDA_LOTE'))
BEGIN		
	ALTER TABLE PG_DEB_DDA_LOTE ADD DV_CONTA VARCHAR(2) NULL
END


IF NOT EXISTS (SELECT * FROM SYS.COLUMNS WHERE NAME = 'CD_CONV_BCO' AND OBJECT_ID = OBJECT_ID('PG_DEB_DDA_LOTE'))
BEGIN		
	ALTER TABLE PG_DEB_DDA_LOTE ADD CD_CONV_BCO VARCHAR(20) NULL
END