ALTER TABLE Trn_FinCuotas ADD Convenio INT DEFAULT(0) NOT NULL
,NitConvenio VARCHAR(16),NumPreMora INT DEFAULT(0) NOT NULL
GO
ALTER TABLE tm_PreCuotas ADD tmConvnio INT DEFAULT(0) NOT NULL
GO
ALTER TABLE Trn_FinPrestamo ADD Refinanciado INT DEFAULT(0) NOT NULL,NumPrestRef INT DEFAULT(0) NOT NULL
,CiaPrestRef CHAR(2),VrRefinanc MONEY DEFAULT(0) NOT NULL,DescRefinanc VARCHAR(150)
GO 
ALTER TABLE Trn_FinCauMora ADD NCuotaLiq INT DEFAULT(0) NOT NULL
GO
ALTER TABLE tm_PreIntMora ADD tmNCuota INT DEFAULT(0)
GO
CREATE TABLE tm_PreVence ( 
tmEst CHAR(2) NOT NULL,
TipDoc VARCHAR(3) NOT NULL,
IdPrestamo INT DEFAULT (0) NOT NULL,
IdCia CHAR(2) DEFAULT ('01') NOT NULL,
NumCuota INT DEFAULT (0) NOT NULL,
Fecha SMALLDATETIME NOT NULL,
FechaVence SMALLDATETIME NOT NULL,
NumDias INT DEFAULT (0) NOT NULL,
VrCuota MONEY DEFAULT (0) NOT NULL,
VrCapital MONEY DEFAULT (0) NOT NULL,
VrInteres MONEY DEFAULT (0) NOT NULL,
VrIntMora MONEY DEFAULT (0) NOT NULL,
VrAbonoCap MONEY DEFAULT (0) NOT NULL,
VrAbonoInt MONEY DEFAULT (0) NOT NULL,
VrSaldo MONEY DEFAULT (0) NOT NULL,
TasaEfeMes DECIMAL(16,8) DEFAULT (0) NOT NULL,
TasaEfeDia DECIMAL(16,8) DEFAULT (0) NOT NULL,
TipoCuota VARCHAR(10) NOT NULL
 CONSTRAINT PK_tm_PreVence PRIMARY KEY CLUSTERED (tmEst,TipDoc,IdPrestamo,IdCia,NumCuota),
 CONSTRAINT CK_tm_PreVenceIdCia CHECK ((len([IdCia]) > 0)),
 CONSTRAINT CK_tm_PreVenceTipDoc CHECK ((len([TipDoc]) > 0)),
 CONSTRAINT CK_tm_PreVenceTipoCuota CHECK ((len([TipoCuota]) > 0)),
 CONSTRAINT CK_tm_PreVencetmEst CHECK ((len([tmEst]) > 0)))
GO