CREATE TABLE LogNomLiquida ( 
TipoLiq VARCHAR(3) NOT NULL,
NumLiq INT DEFAULT ((0)) NOT NULL,
Item INT DEFAULT ((0)) NOT NULL,
Fecha SMALLDATETIME NOT NULL,
IdEmpleado VARCHAR(16) NOT NULL,
NomEmpleado VARCHAR(250),
IdConcepto VARCHAR(4) NOT NULL,
Detalle VARCHAR(100),
FecUltLiq SMALLDATETIME NOT NULL,
FecInicial SMALLDATETIME NOT NULL,
FecFinal SMALLDATETIME NOT NULL,
VrBase MONEY DEFAULT ((0)) NOT NULL,
Cantidad INT DEFAULT ((0)) NOT NULL,
VrLiquida MONEY DEFAULT ((0)) NOT NULL,
VrDeducido MONEY DEFAULT ((0)) NOT NULL,
FecIniPmd SMALLDATETIME,
FecFinPmd SMALLDATETIME,
DiasBase INT DEFAULT ((0)) NOT NULL,
DiasNoRem INT DEFAULT ((0)) NOT NULL,
Tarifa DECIMAL(14,4) DEFAULT ((0)) NOT NULL,
NPrestamo INT DEFAULT ((0)) NOT NULL,
NCuota INT DEFAULT ((0)) NOT NULL,
LogProm VARCHAR(600),
NContrato INT DEFAULT ((0)) NOT NULL,
pVehiculo VARCHAR(10),
IdDep VARCHAR(4) NOT NULL,
IdCCosto VARCHAR(16) NOT NULL,
IdSubCos VARCHAR(16) NOT NULL,
IdNom VARCHAR(4) NOT NULL,
VrSalario MONEY DEFAULT ((0)),
VrParcial MONEY DEFAULT ((0)),
Estado INT DEFAULT ((0)) NOT NULL,
FechaCrea SMALLDATETIME,
IdUsuario VARCHAR(11) NOT NULL,
Nombre VARCHAR(50) NOT NULL
 CONSTRAINT PK_LogNomLiquida PRIMARY KEY CLUSTERED (TipoLiq,NumLiq,Item),
 CONSTRAINT CK_LogNomLiquidaIdCCosto CHECK ((len([IdCCosto])>(0))),
 CONSTRAINT CK_LogNomLiquidaIdConcepto CHECK ((len([IdConcepto])>(0))),
 CONSTRAINT CK_LogNomLiquidaIdDep CHECK ((len([IdDep])>(0))),
 CONSTRAINT CK_LogNomLiquidaIdEmpleado CHECK ((len([IdEmpleado])>(0))),
 CONSTRAINT CK_LogNomLiquidaIdNom CHECK ((len([IdNom])>(0))),
 CONSTRAINT CK_LogNomLiquidaIdSubCos CHECK ((len([IdSubCos])>(0))),
 CONSTRAINT CK_LogNomLiquidaIdUsuario CHECK ((len([IdUsuario])>(0))),
 CONSTRAINT CK_LogNomLiquidaNombre CHECK ((len([Nombre])>(0))),
 CONSTRAINT CK_LogNomLiquidaTipoLiq CHECK ((len([TipoLiq])>(0))))
GO
 CREATE NONCLUSTERED INDEX IX_LogNomLiquidaFecha ON LogNomLiquida(Fecha)
