ALTER TABLE TMPLEGCOM ADD TMP_NIT VARCHAR(11)
GO
ALTER TABLE TMPVCRE ADD TMP_ITV INT DEFAULT(0)
GO
CREATE TABLE TMPGPN ( 
TMP_UID CHAR(2) NOT NULL,
TMP_CUE VARCHAR(16) NOT NULL,
TMP_CIA CHAR(2) NOT NULL,
TMP_CC VARCHAR(3) NOT NULL,
TMP_ID INT DEFAULT ((0)) NOT NULL,
TMP_NOS BIT DEFAULT ((0)) NOT NULL,
TMP_SAN MONEY DEFAULT ((0)),
TMP_DEB MONEY DEFAULT ((0)),
TMP_CRE MONEY DEFAULT ((0)),
TMP_SAL MONEY DEFAULT ((0)),
TMP_SA2 MONEY DEFAULT ((0)),
TMP_DB2 MONEY DEFAULT ((0)),
TMP_CR2 MONEY DEFAULT ((0)),
TMP_NS2 MONEY DEFAULT ((0))
 CONSTRAINT PK_TMPGPN PRIMARY KEY CLUSTERED (TMP_UID,TMP_CUE,TMP_CIA,TMP_CC,TMP_ID),
 CONSTRAINT CK_TMPGPNTMP_CC CHECK ((len([TMP_CC])>(0))),
 CONSTRAINT CK_TMPGPNTMP_CIA CHECK ((len([TMP_CIA])>(0))),
 CONSTRAINT CK_TMPGPNTMP_CUE CHECK ((len([TMP_CUE])>(0))),
 CONSTRAINT CK_TMPGPNTMP_UID CHECK ((len([TMP_UID])>(0))))
GO