CREATE TABLE LogTmConsIns ( 
Id INT IDENTITY ( 1,1 ) NOT NULL,
IdUsuario VARCHAR(5) NOT NULL,
Item INT DEFAULT ((0)) NOT NULL,
IdInsumo VARCHAR(16) NOT NULL,
IdBodega VARCHAR(4) NOT NULL,
Cantidad DECIMAL(14,4) DEFAULT ((0)) NOT NULL,
CantSaldo DECIMAL(14,4) DEFAULT ((0)) NOT NULL,
CantTraslado DECIMAL(14,4) DEFAULT ((0)) NOT NULL,
CantConsumo DECIMAL(14,4) DEFAULT ((0)) NOT NULL,
CantDevuelto DECIMAL(14,4) DEFAULT ((0)) NOT NULL,
CdBodTdo VARCHAR(4) NOT NULL,
IdTipProc VARCHAR(4) NOT NULL,
TipTdo VARCHAR(3),
Traslado INT DEFAULT ((0)) NOT NULL,
IdCiaTdo CHAR(2),
Descripcion VARCHAR(500),
Bodega VARCHAR(50),
BodegaTdo VARCHAR(50),
Proceso VARCHAR(150)
 CONSTRAINT PK_LogTmConsIns PRIMARY KEY CLUSTERED (Id),
 CONSTRAINT CK_LogTmConsInsCdBodTdo CHECK ((len([CdBodTdo])>(0))),
 CONSTRAINT CK_LogTmConsInsIdBodega CHECK ((len([IdBodega])>(0))),
 CONSTRAINT CK_LogTmConsInsIdInsumo CHECK ((len([IdInsumo])>(0))),
 CONSTRAINT CK_LogTmConsInsIdTipProc CHECK ((len([IdTipProc])>(0))),
 CONSTRAINT CK_LogTmConsInsIdUsuario CHECK ((len([IdUsuario])>(0))))
GO
 CREATE NONCLUSTERED INDEX IX_LogTmConsInsIdUsuario ON LogTmConsIns(IdUsuario,Item)
