ALTER TABLE TMPCCC ADD TMP_CUN VARCHAR(16)
GO
CREATE TABLE TMPLDN ( 
TMP_TIP VARCHAR(3) NOT NULL,
TMP_CIA CHAR(2) DEFAULT ('00') NOT NULL,
TMP_CUE VARCHAR(16) NOT NULL,
TMP_ID INT DEFAULT ((0)) NOT NULL,
TMP_UID CHAR(2) DEFAULT ('01') NOT NULL,
TMP_DEB MONEY DEFAULT ((0)),
TMP_CRE MONEY DEFAULT ((0)),
TMP_SCU MONEY DEFAULT ((0)),
TMP_SCI MONEY DEFAULT ((0)),
TMP_SAN MONEY DEFAULT ((0)),
TMP_SAL MONEY DEFAULT ((0))
 CONSTRAINT PK_TMPLDN PRIMARY KEY CLUSTERED (TMP_TIP,TMP_CIA,TMP_CUE,TMP_ID,TMP_UID),
 CONSTRAINT CK_TMPLDNTMP_CIA CHECK ((len([TMP_CIA])>(0))),
 CONSTRAINT CK_TMPLDNTMP_CUE CHECK ((len([TMP_CUE])>(0))),
 CONSTRAINT CK_TMPLDNTMP_TIP CHECK ((len([TMP_TIP])>(0))),
 CONSTRAINT CK_TMPLDNTMP_UID CHECK ((len([TMP_UID])>(0))))
GO
