--SE MODIFICA TIPO DE DATO CAMPO TMP_ID (LLAVE) 
IF OBJECT_ID('dbo.TMPLBC', 'U') IS NOT NULL 
  DROP TABLE dbo.TMPLBC 
GO
CREATE TABLE TMPLBC ( 
TMP_CUE VARCHAR(16) NOT NULL,
TMP_CIA CHAR(2) DEFAULT ('00') NOT NULL,
TMP_NIT VARCHAR(11) DEFAULT ('000') NOT NULL,
TMP_CC VARCHAR(3) DEFAULT ('000') NOT NULL,
TMP_ID INT DEFAULT (0) NOT NULL,
TMP_UID CHAR(2) DEFAULT ('01') NOT NULL,
TMP_DES VARCHAR(30),
TMP_SAN MONEY DEFAULT (0),
TMP_DEB MONEY DEFAULT (0),
TMP_CRE MONEY DEFAULT (0),
TMP_SAL MONEY DEFAULT (0),
TMP_NOS BIT DEFAULT (0) NOT NULL,
TMP_AGE VARCHAR(9) DEFAULT ('N')
 CONSTRAINT PK_TMPLBC PRIMARY KEY CLUSTERED (TMP_CUE,TMP_CIA,TMP_NIT,TMP_CC,TMP_ID,TMP_UID),
 CONSTRAINT CK__TMPLBC__TMP_CC__7073AF84 CHECK ((len([TMP_CC]) > 0)),
 CONSTRAINT CK__TMPLBC__TMP_CIA__6CA31EA0 CHECK ((len([TMP_CIA]) > 0)),
 CONSTRAINT CK__TMPLBC__TMP_CUE__6ABAD62E CHECK ((len([TMP_CUE]) > 0)),
 CONSTRAINT CK__TMPLBC__TMP_NIT__6E8B6712 CHECK ((len([TMP_NIT]) > 0)))
