ALTER TABLE PLATRANS ADD PLA_MVA VARCHAR(3)
GO
ALTER TABLE REMESAS ADD REM_NPM VARCHAR(11)
GO
CREATE TABLE PLATIEMPOS ( 
HOR_TIP VARCHAR(3) NOT NULL,
HOR_NUM INT DEFAULT ((0)) NOT NULL,
HOR_CIA CHAR(2) NOT NULL,
HOR_ITM INT DEFAULT ((0)) NOT NULL,
HOR_TDC VARCHAR(3) NOT NULL,
HOR_DOC INT DEFAULT ((0)) NOT NULL,
HOR_CDC CHAR(2) NOT NULL,
HOR_TEC DECIMAL(14,4) DEFAULT ((0)) NOT NULL,
HOR_TED DECIMAL(14,4) DEFAULT ((0)) NOT NULL,
HOR_FIC SMALLDATETIME,
HOR_FFC SMALLDATETIME,
HOR_FID SMALLDATETIME,
HOR_FFD SMALLDATETIME,
HOR_TRC DECIMAL(14,4) DEFAULT ((0)),
HOR_TRD DECIMAL(14,4) DEFAULT ((0)),
HOR_FLC SMALLDATETIME,
HOR_FSC SMALLDATETIME,
HOR_FLD SMALLDATETIME,
HOR_FSD SMALLDATETIME
 CONSTRAINT PK_PLATIEMPOS PRIMARY KEY CLUSTERED (HOR_TIP,HOR_NUM,HOR_CIA,HOR_ITM),
 CONSTRAINT CK_PLATIEMPOSHOR_CDC CHECK ((len([HOR_CDC])>(0))),
 CONSTRAINT CK_PLATIEMPOSHOR_CIA CHECK ((len([HOR_CIA])>(0))),
 CONSTRAINT CK_PLATIEMPOSHOR_TDC CHECK ((len([HOR_TDC])>(0))),
 CONSTRAINT CK_PLATIEMPOSHOR_TIP CHECK ((len([HOR_TIP])>(0))))
GO
