CREATE TABLE TIPOSCOMRES ( 
 RES_COD VARCHAR(3) NOT NULL,
 RES_DES VARCHAR(50) NOT NULL,
 RES_PRE VARCHAR(5) NULL,
 RES_INI INT NOT NULL DEFAULT (0),
 RES_FIN INT NOT NULL DEFAULT (0),
 RES_FEC SMALLDATETIME NOT NULL,
 RES_FVC SMALLDATETIME NULL,
 RES_EST VARCHAR(100) NULL
 CONSTRAINT PK_TIPOSCOMRES PRIMARY KEY CLUSTERED (RES_COD),
 CONSTRAINT CK_TIPOSCOMRES_RES_DES CHECK ((len(RES_DES) > 0))
 )
GO
ALTER TABLE TIPOSCOMP ADD TIP_SOP BIT DEFAULT(0)
GO
ALTER TABLE CONSCOM ADD CON_RES VARCHAR(3)
GO
ALTER TABLE CONCEPTOSFAC ADD CON_CDG VARCHAR(16),CON_CDO VARCHAR(16),CON_CDC VARCHAR(16)
GO