CREATE TABLE TMPCTL ( 
TMP_NUM VARCHAR(5) NOT NULL,
TMP_ITM INT DEFAULT ((0)) NOT NULL,
TMP_PTO INT DEFAULT ((0)) NOT NULL,
TMP_TCD CHAR(1) NOT NULL,
TMP_PCA DECIMAL(14,4) DEFAULT ((0)) NOT NULL,
TMP_PDE DECIMAL(14,4) DEFAULT ((0)) NOT NULL,
TMP_FLC SMALLDATETIME,
TMP_FSC SMALLDATETIME,
TMP_FLD SMALLDATETIME,
TMP_FSD SMALLDATETIME,
TMP_CHC DECIMAL(14,4) DEFAULT ((0)) NOT NULL,
TMP_CHD DECIMAL(14,4) DEFAULT ((0)) NOT NULL,
TMP_CAC DECIMAL(14,4) DEFAULT ((0)) NOT NULL,
TMP_CAD DECIMAL(14,4) DEFAULT ((0)) NOT NULL,
TMP_CSC DECIMAL(14,4) DEFAULT ((0)) NOT NULL,
TMP_CSD DECIMAL(14,4) DEFAULT ((0)) NOT NULL,
TMP_REM INT DEFAULT ((0)) NOT NULL,
TMP_CRM CHAR(2)
 CONSTRAINT PK_TMPCTL PRIMARY KEY CLUSTERED (TMP_NUM,TMP_ITM),
 CONSTRAINT CK_TMPCTLTMP_NUM CHECK ((len([TMP_NUM])>(0))),
 CONSTRAINT CK_TMPCTLTMP_TCD CHECK (([TMP_TCD]='D' OR [TMP_TCD]='C')))
GO