CREATE TABLE Trn_FinPrestRefina ( 
TipDoc VARCHAR(3) DEFAULT ('PR1') NOT NULL,
IdPrestamo INT DEFAULT ((0)) NOT NULL,
IdCia CHAR(2) DEFAULT ('01') NOT NULL,
Item INT DEFAULT ((0)) NOT NULL,
NumPreRef INT NOT NULL,
CdCiaRef CHAR(2) NOT NULL,
Concepto VARCHAR(10) DEFAULT ('CAPITAL') NOT NULL,
VrTotal MONEY DEFAULT ((0)) NOT NULL,
VrAbonado MONEY DEFAULT ((0)) NOT NULL,
VrSaldo MONEY DEFAULT ((0)) NOT NULL,
VrBaseLiq MONEY DEFAULT ((0)) NOT NULL
 CONSTRAINT PK_Trn_FinPrestRefina PRIMARY KEY CLUSTERED (TipDoc,IdPrestamo,IdCia,Item),
 CONSTRAINT CK_Trn_FinPrestRefinaCdCiaRef CHECK ((len([CdCiaRef])>(0))),
 CONSTRAINT CK_Trn_FinPrestRefinaConcepto CHECK ((len([Concepto])>(0))),
 CONSTRAINT CK_Trn_FinPrestRefinaIdCia CHECK ((len([IdCia])>(0))),
 CONSTRAINT CK_Trn_FinPrestRefinaTipDoc CHECK ((len([TipDoc])>(0))))
GO
 CREATE NONCLUSTERED INDEX IX_Trn_FinPrestRefinaNumPreRef ON Trn_FinPrestRefina(NumPreRef,CdCiaRef)
