ALTER TABLE SUBGRUPOS ADD SUB_IOC VARCHAR(16),SUB_IOD VARCHAR(16),SUB_IOV VARCHAR(16),SUB_IOE VARCHAR(16)
GO
CREATE TABLE POLITICASCLA ( 
CLA_ID INT DEFAULT ((0)) NOT NULL,
CLA_DES VARCHAR(100) NOT NULL
 CONSTRAINT PK_POLITICASCLA PRIMARY KEY CLUSTERED (CLA_ID),
 CONSTRAINT CK_POLITICASCLACLA_DES CHECK ((len([CLA_DES])>(0))))
CREATE TABLE POLITICASCUE ( 
POL_ID INT DEFAULT ((0)) NOT NULL,
POL_CUE VARCHAR(16) NOT NULL
 CONSTRAINT PK_POLITICASCUE PRIMARY KEY CLUSTERED (POL_ID,POL_CUE))
CREATE TABLE POLITICASNIIF ( 
POL_ID INT DEFAULT ((0)) NOT NULL,
POL_DES VARCHAR(250) NOT NULL,
POL_CLA VARCHAR(100) NOT NULL,
POL_OBJ VARCHAR(1000),
POL_ALC VARCHAR(2500),
POL_REC VARCHAR(2500),
POL_MED VARCHAR(2000) NOT NULL,
POL_MPO VARCHAR(2000),
POL_VIG INT DEFAULT ((0)) NOT NULL,
POL_DVG VARCHAR(250),
POL_OBS VARCHAR(1000),
POL_ANX VARCHAR(150),
POL_INA BIT DEFAULT ((0)) NOT NULL,
POL_FCR SMALLDATETIME NOT NULL,
POL_USU VARCHAR(8) NOT NULL
 CONSTRAINT PK_POLITICASNIIF PRIMARY KEY CLUSTERED (POL_ID),
 CONSTRAINT CK_POLITICASNIIFPOL_CLA CHECK ((len([POL_CLA])>(0))),
 CONSTRAINT CK_POLITICASNIIFPOL_DES CHECK ((len([POL_DES])>(0))),
 CONSTRAINT CK_POLITICASNIIFPOL_USU CHECK ((len([POL_USU])>(0)))) 
GO
INSERT INTO CODCUENTAS (COD_TIP,COD_ID,COD_DES,COD_ORD)
VALUES ('ENT','IVO','IVA OBSEQUIOS',17)
INSERT INTO CODCUENTAS (COD_TIP,COD_ID,COD_DES,COD_ORD)
VALUES ('DVE','IVO','IVA OBSEQUIOS',17)
INSERT INTO CODCUENTAS (COD_TIP,COD_ID,COD_DES,COD_ORD)
VALUES ('FCR','IVO','IVA OBSEQUIOS',18)
INSERT INTO CODCUENTAS (COD_TIP,COD_ID,COD_DES,COD_ORD)
VALUES ('FCO','IVO','IVA OBSEQUIOS',16)
INSERT INTO CODCUENTAS (COD_TIP,COD_ID,COD_DES,COD_ORD)
VALUES ('DF1','IVO','IVA OBSEQUIOS',18)
INSERT INTO CODCUENTAS (COD_TIP,COD_ID,COD_DES,COD_ORD)
VALUES ('DF0','IVO','IVA OBSEQUIOS',16)

