CREATE TABLE NIIFCOMPINDICE ( 
COM_TIP VARCHAR(3) NOT NULL,
COM_NUM INT DEFAULT ((0)) NOT NULL,
COM_CIA CHAR(2) DEFAULT ('01') NOT NULL,
COM_FEC SMALLDATETIME NOT NULL,
COM_ELI BIT DEFAULT ((0)) NOT NULL,
COM_ANU BIT DEFAULT ((0)) NOT NULL,
COM_DEV BIT DEFAULT ((0)) NOT NULL,
COM_NDV INT DEFAULT ((0)),
COM_FDV SMALLDATETIME,
COM_DOC VARCHAR(3),
COM_NDC INT DEFAULT ((0))
 CONSTRAINT PK_NIIFCOMPINDICE PRIMARY KEY CLUSTERED (COM_TIP,COM_NUM,COM_CIA),
 CONSTRAINT CK_NIIFCOMPINDICECOM_CIA CHECK ((len([COM_CIA])>(0))),
 CONSTRAINT CK_NIIFCOMPINDICECOM_TIP CHECK ((len([COM_TIP])>(0))))
GO
 CREATE NONCLUSTERED INDEX IX_NIIFCOMPINDICECOM_FEC ON NIIFCOMPINDICE(COM_FEC)
