CREATE TABLE NIIFREVELACIONES ( 
REV_TIP VARCHAR(3) NOT NULL,
REV_NUM INT DEFAULT ((0)) NOT NULL,
REV_CIA CHAR(2) DEFAULT ('01') NOT NULL,
REV_ITM INT DEFAULT ((0)) NOT NULL,
REV_TRV VARCHAR(10) DEFAULT ('COMP') NOT NULL,
REV_TIT VARCHAR(250),
REV_OBS VARCHAR(5000) NOT NULL,
REV_CUE VARCHAR(16),
REV_FEC SMALLDATETIME NOT NULL,
REV_USU VARCHAR(10) NOT NULL
 CONSTRAINT PK_NIIFREVELACIONES PRIMARY KEY CLUSTERED (REV_TIP,REV_NUM,REV_CIA,REV_ITM),
 CONSTRAINT CK_NIIFREVELACIONESREV_CIA CHECK ((len([REV_CIA])>(0))),
 CONSTRAINT CK_NIIFREVELACIONESREV_TIP CHECK ((len([REV_TIP])>(0))),
 CONSTRAINT CK_NIIFREVELACIONESREV_TRV CHECK ((len([REV_TRV])>(0))),
 CONSTRAINT CK_NIIFREVELACIONESREV_USU CHECK ((len([REV_USU])>(0))))
GO
