CREATE TABLE TMPCUM ( 
TMP_NUM VARCHAR(5) NOT NULL,
TMP_ITM INT DEFAULT ((0)) NOT NULL,
TMP_TDC VARCHAR(3) NOT NULL,
TMP_NDC INT DEFAULT ((0)) NOT NULL,
TMP_CDC CHAR(2) NOT NULL,
TMP_IDC INT DEFAULT ((0)) NOT NULL,
TMP_FDC SMALLDATETIME NOT NULL,
TMP_PES DECIMAL(14,4) DEFAULT ((0)) NOT NULL,
TMP_KGO DECIMAL(14,4) DEFAULT ((0)) NOT NULL,
TMP_VAL MONEY DEFAULT ((0)) NOT NULL,
TMP_COS MONEY DEFAULT ((0)) NOT NULL,
TMP_NET MONEY DEFAULT ((0)) NOT NULL,
TMP_ORI VARCHAR(8),
TMP_CDE VARCHAR(8),
TMP_UNI VARCHAR(3),
TMP_NOV VARCHAR(3),
TMP_RF1 VARCHAR(250),
TMP_RF2 VARCHAR(250),
TMP_RF3 VARCHAR(250),
TMP_KRM DECIMAL(14,4) DEFAULT ((0)) NOT NULL,
TMP_VRM MONEY DEFAULT ((0)) NOT NULL,
TMP_CRM MONEY DEFAULT ((0)) NOT NULL,
TMP_NRM MONEY DEFAULT ((0)) NOT NULL,
TMP_COD VARCHAR(13),
TMP_DES VARCHAR(250),
TMP_CAN VARCHAR(10),
TMP_CC VARCHAR(3),
TMP_CLI VARCHAR(11),
TMP_AGE VARCHAR(9)
 CONSTRAINT PK_TMPCUM PRIMARY KEY CLUSTERED (TMP_NUM,TMP_ITM),
 CONSTRAINT CK_TMPCUMTMP_CDC CHECK ((len([TMP_CDC])>(0))),
 CONSTRAINT CK_TMPCUMTMP_NUM CHECK ((len([TMP_NUM])>(0))),
 CONSTRAINT CK_TMPCUMTMP_TDC CHECK ((len([TMP_TDC])>(0))))
GO
ALTER TABLE TMPFCR ADD TMP_CUM INT DEFAULT(0),TMP_CCU MONEY DEFAULT(0)
GO