CREATE TABLE [dbo].[TN_SYS_ALLTYPETECHNICIS] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_TABLENAME] [char] (64) NOT NULL ,
	[CN_SHOWNAME] [char] (128) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_APPTYPE] (
	[CN_APPTYPE] [char] (64) NOT NULL ,
	[CN_DESCRIBE] [char] (128) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_AUDIT] (
	[CN_NAME] [char] (64) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_BASERULE] (
	[CN_NAME] [char] (64) NULL ,
	[CN_BASENAME] [char] (64) NULL ,
	[CN_BASEFIELD] [char] (64) NULL ,
	[CN_CARDVAR] [char] (64) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPALLOT] (
	[CN_CAPPID] [int] NOT NULL ,
	[CN_ALLOT_TYPE] [int] NOT NULL ,
	[CN_ALLOT_INFO] [char] (64) NOT NULL ,
	[CN_STEPID] [int] NOT NULL ,
	[CN_CAPPOBJID] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPBLOB] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_COMPRESSED] [bit] NOT NULL ,
	[CN_BLOB] [image] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPBOM] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_STRUINFO] [char] (128) NOT NULL ,
	[CN_PRODUCT_KIND] [char] (64) NOT NULL ,
	[CN_PRODUCT_NAME] [char] (64) NOT NULL ,
	[CN_PART_CODE] [char] (64) NOT NULL ,
	[CN_PART_NAME] [char] (64) NOT NULL ,
	[CN_MATERIAL_MARK] [char] (64) NOT NULL ,
	[CN_PART_CLASSID] [int] NOT NULL ,
	[CN_PART_OBJID] [int] NOT NULL ,
	[CN_PART_VERSION] [char] (64) NOT NULL ,
	[CN_MATERIAL_ID] [int] NOT NULL ,
	[CN_CREATE_NAME] [char] (64) NOT NULL ,
	[CN_CREATE_DATE] [datetime] NOT NULL ,
	[CN_GROUPNAME] [char] (64) NOT NULL ,
	[CN_NOTE] [varchar] (256) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPCARD] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_NAME] [char] (60) NOT NULL ,
	[CN_DESCRIBE] [char] (256) NULL ,
	[CN_CARDTYPE] [int] NOT NULL ,
	[CN_PARENTCARDID] [int] NULL ,
	[CN_REL_MIDDATAID] [int] NULL ,
	[CN_CREATEDATE] [datetime] NULL ,
	[CN_MODIFYDATE] [datetime] NULL ,
	[CN_DEFFILE_BLOBID] [int] NOT NULL ,
	[CN_INDEXTBNAME] [char] (64) NOT NULL ,
	[CN_INDEXTBNAME_TYPICAL] [char] (64) NOT NULL ,
	[CN_ISFOLDER] [bit] NOT NULL ,
	[CN_PARENTID] [int] NOT NULL ,
	[CN_DEFAULT] [bit] NOT NULL ,
	[CN_ISDELETE] [bit] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPCARD_REL] (
	[CN_MASTER_CARDNAME] [char] (64) NULL ,
	[CN_SECOND_CARDNAME] [char] (64) NULL ,
	[CN_REL] [int] NULL ,
	[CN_ORDER] [int] NULL ,
	[CN_ISDEFAULT] [bit] NULL ,
	[CN_ISDELETE] [bit] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPCARD_SUBTABINFO] (
	[CN_CARDNAME] [char] (64) NULL ,
	[CN_TABLENAME] [char] (60) NULL ,
	[CN_NAME] [char] (60) NULL ,
	[CN_TYPE] [int] NULL ,
	[CN_TYPEEX] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPCARDMD] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_NAME] [char] (60) NOT NULL ,
	[CN_DESCRIBE] [char] (256) NULL ,
	[CN_CARDID] [int] NOT NULL ,
	[CN_MDTYPE] [int] NOT NULL ,
	[CN_SOURCEMD] [char] (60) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPCARDSUBTABLE] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_NAME] [char] (60) NOT NULL ,
	[CN_DESCRIBE] [char] (256) NULL ,
	[CN_CARDID] [int] NOT NULL ,
	[CN_TABLENAME] [char] (60) NULL ,
	[CN_TABLETYPE] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPCENTER] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_BOMID] [int] NOT NULL ,
	[CN_VERSION] [char] (64) NOT NULL ,
	[CN_ISACTIVE] [bit] NOT NULL ,
	[CN_CAPPSTATE] [int] NOT NULL ,
	[CN_ISMODIFY] [bit] NOT NULL ,
	[CN_CREATE_NAME] [char] (64) NOT NULL ,
	[CN_CREATE_DATE] [datetime] NOT NULL ,
	[CN_END_DATE] [datetime] NOT NULL ,
	[CN_REALEND_DATE] [datetime] NOT NULL ,
	[CN_CAPPFLOW] [varchar] (256) NULL ,
	[CN_ALLOT_USERID] [int] NOT NULL ,
	[CN_DOCLIST] [varchar] (256) NULL ,
	[CN_NOTE] [varchar] (256) NULL ,
	[CN_HAVECARD] [bit] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPCODESEGMENT] (
	[CN_CODESEGMENT_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_RULE_ID] [int] NOT NULL ,
	[CN_CODESEGMENT_NAME] [char] (32) NOT NULL ,
	[CN_CODESEGMENT_ORDER] [int] NULL ,
	[CN_CODESEGMENT_TYPE] [int] NULL ,
	[CN_CODESEGMENT_SIZE] [int] NULL ,
	[CN_CODESEGMENT_DESCRIBE] [char] (124) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPCODEVALUE] (
	[CN_RULE_ID] [int] NOT NULL ,
	[CN_CODESEGMENT_ID] [int] NOT NULL ,
	[CN_CODESEGMENT_VALUE] [char] (32) NOT NULL ,
	[CN_CODEVALUE_DESCRIBE] [char] (124) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPMAIL] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_TOPIC] [char] (128) NULL ,
	[CN_DATA] [varchar] (128) NULL ,
	[CN_SEND_USERID] [int] NULL ,
	[CN_SEND_USERNAME] [char] (10) NULL ,
	[CN_INCEPT_USERID] [int] NULL ,
	[CN_INCEPT_USERNAME] [char] (10) NULL ,
	[CN_SEND_DATE] [datetime] NULL ,
	[CN_AFFIXDOC_NAME] [char] (128) NULL ,
	[CN_AFFIXDOC_ID] [char] (128) NULL ,
	[CN_STATE] [int] NULL ,
	[CN_BLEVELHIGH] [bit] NOT NULL ,
	[CN_OBJID] [int] NULL ,
	[CN_GROUPID] [int] NULL ,
	[CN_OWNERID] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPMAIL_BLOB] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_COMPRESSED] [bit] NOT NULL ,
	[CN_BLOB] [image] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPMGR_BLOB] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_COMPRESSED] [bit] NOT NULL ,
	[CN_BLOB] [image] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPMGRCLASS] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_CLASSNAME] [char] (64) NOT NULL ,
	[CN_DISPFORMAT] [char] (64) NOT NULL ,
	[CN_ISPRIMARY] [bit] NOT NULL ,
	[CN_MARK] [char] (128) NOT NULL ,
	[CN_BLOBID] [int] NOT NULL ,
	[CN_ISDRAWING] [bit] NOT NULL ,
	[CN_ISFILLCAPP] [bit] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPMGRCLASSREL] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_CLASSID] [int] NOT NULL ,
	[CN_SUB_CLASSID] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPOBJ] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_NAME] [char] (64) NOT NULL ,
	[CN_BLOBID] [int] NOT NULL ,
	[CN_CREATE_NAME] [char] (10) NOT NULL ,
	[CN_CREATE_DATE] [datetime] NOT NULL ,
	[CN_PLANEND_DATE] [datetime] NOT NULL ,
	[CN_REALEND_DATE] [datetime] NOT NULL ,
	[CN_MAINCARDS] [varchar] (1024) NOT NULL ,
	[CN_REMARK] [varchar] (64) NULL ,
	[KEY_OWNERNAME] [char] (64) NULL ,
	[KEY_OWNERCODE] [char] (64) NULL ,
	[KEY_VER] [char] (64) NULL ,
	[KEY_FEATURE] [char] (64) NULL ,
	[CN_LOCKUSER_ID] [int] NULL ,
	[CN_LOCKUSER_NAME] [char] (10) NULL ,
	[CN_PAGECOUNT] [int] NULL ,
	[KEY_EXT] [varchar] (50) NULL ,
	[KEY_OWNERVER] [char] (64) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPOBJ_BLOB] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_COMPRESSED] [bit] NOT NULL ,
	[CN_BLOB] [image] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPOBJ_DBREG] (
	[CN_TABLENAME] [char] (64) NULL ,
	[KEY_OWNERNAME] [char] (64) NULL ,
	[KEY_OWNERCODE] [char] (64) NULL ,
	[KEY_OWNERVER] [char] (64) NULL ,
	[KEY_EXT] [char] (64) NULL ,
	[KEY_FEATURE] [char] (64) NULL ,
	[KEY_VER] [char] (64) NULL ,
	[CN_CARDCODE] [char] (10) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPOBJ_INDEX] (
	[CN_CAPPOBJ_ID] [int] NOT NULL ,
	[CN_CAPPBOM_ID] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPOBJ_OUTINFO] (
	[KEY_OWNERNAME] [char] (64) NULL ,
	[KEY_OWNERCODE] [char] (64) NULL ,
	[KEY_VER] [char] (64) NULL ,
	[KEY_EXT] [char] (64) NULL ,
	[KEY_FEATURE] [char] (64) NULL ,
	[CN_EXT] [char] (64) NULL ,
	[CN_PJ_TEST] [char] (300) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPOBJ_OUTPUTDATA] (
	[CN_CAPPOBJID] [int] NOT NULL ,
	[CN_CARDNAME] [char] (64) NULL ,
	[CN_CARDCODE] [char] (10) NULL ,
	[CN_DATA] [varchar] (1024) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPOBJ_QUEUE_LOG] (
	[CN_CAPPOBJID] [int] NULL ,
	[CN_CARDNAME] [char] (64) NULL ,
	[CN_OWNERNAME] [char] (64) NULL ,
	[CN_WONERCODE] [char] (64) NULL ,
	[CN_ORDER] [int] NULL ,
	[CN_QUEUENAME] [char] (64) NULL ,
	[CN_USER_ID] [int] NULL ,
	[CN_USER_NAME] [char] (64) NULL ,
	[CN_USER_TYPE] [int] NULL ,
	[CN_ASSISTER_ID] [int] NULL ,
	[CN_ASSISTER_NAME] [char] (64) NULL ,
	[CN_ASSISTER_TYPE] [int] NULL ,
	[CN_EXT] [char] (512) NULL ,
	[CN_PLANEND_DATE] [datetime] NULL ,
	[CN_REALEND_DATE] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPOBJ_SPECTATOR] (
	[CN_CAPPOBJID] [int] NULL ,
	[CN_ORDER] [int] NULL ,
	[CN_USER_ID] [int] NULL ,
	[CN_USER_NAME] [char] (64) NULL ,
	[CN_USER_TYPE] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPOBJ_WORK] (
	[CN_CAPPOBJ_ID] [int] NOT NULL ,
	[CN_WORKTYPE] [int] NOT NULL ,
	[CN_WORKNAME] [char] (64) NOT NULL ,
	[CN_WORKUSER] [varchar] (128) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPOBJ_WORKINFO] (
	[CN_CAPPOBJID] [int] NULL ,
	[CN_WORKUSER_NAME] [char] (64) NULL ,
	[CN_WORKUSER_ID] [int] NULL ,
	[CN_WORKUSER_TYPE] [int] NULL ,
	[CN_ASSISTER_NAME] [char] (64) NULL ,
	[CN_ASSISTER_ID] [int] NULL ,
	[CN_ASSISTER_TYPE] [int] NULL ,
	[CN_WORKTYPE] [int] NULL ,
	[CN_WORKSTEPNAME] [char] (64) NULL ,
	[CN_AUDIT] [char] (64) NULL ,
	[CN_EXT] [char] (128) NULL ,
	[CN_WORKCHANGSCRIPT] [char] (64) NULL ,
	[CN_CURWORKUSER_ID] [int] NULL ,
	[CN_CURWORKUSER_NAME] [char] (64) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPOBJ_WORKQUEUE] (
	[CN_CAPPOBJID] [int] NULL ,
	[CN_ORDER] [int] NULL ,
	[CN_NAME] [char] (64) NULL ,
	[CN_USER_ID] [int] NOT NULL ,
	[CN_USER_NAME] [char] (64) NULL ,
	[CN_USER_TYPE] [int] NULL ,
	[CN_ASSISTER_ID] [int] NULL ,
	[CN_ASSISTER_NAME] [char] (64) NULL ,
	[CN_ASSISTER_TYPE] [int] NULL ,
	[CN_EXT] [varchar] (128) NULL ,
	[CN_REALEND_DATE] [datetime] NOT NULL ,
	[CN_PLANEND_DATE] [datetime] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPOUTVALUE] (
	[CN_SYS_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_SYS_CAPPBOMID] [int] NOT NULL ,
	[零件图号] [char] (64) NULL ,
	[零件名称] [char] (60) NULL ,
	[材料牌号] [char] (60) NULL ,
	[产品型号] [char] (64) NULL ,
	[产品名称] [char] (64) NULL ,
	[所属装配件图号] [char] (64) NULL ,
	[所属装配件名称] [char] (64) NULL ,
	[数量] [int] NULL ,
	[aaa] [char] (20) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPPRIVYINFO] (
	[CN_NAME] [char] (64) NOT NULL ,
	[CN_INFO] [varchar] (640) NOT NULL ,
	[CN_USERID] [int] NOT NULL ,
	[CN_INTINFO] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPRPTBLOB] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_COMPRESSED] [bit] NOT NULL ,
	[CN_BLOB] [image] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPRULE] (
	[CN_RULE_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_RULE_NAME] [char] (64) NOT NULL ,
	[CN_RULE_DESCRIBE] [char] (124) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPSEED] (
	[CN_CODEVALUE] [char] (124) NOT NULL ,
	[CN_RULE_ID] [int] NOT NULL ,
	[CN_SEED] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPSTAT] (
	[CN_NAME] [char] (60) NOT NULL ,
	[CN_STATBLOBID] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPSTATBIND] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_NAME] [char] (64) NOT NULL ,
	[CN_DISTYPE] [int] NOT NULL ,
	[CN_STATOBJNAME] [char] (64) NOT NULL ,
	[CN_STATMEANSNAME] [char] (64) NOT NULL ,
	[CN_DESCRIBE] [char] (128) NULL ,
	[CN_MEANSWHERENAME] [char] (64) NULL ,
	[CN_DATAOUTTYPE] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPSTATTEMPTB] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_STATOBJECTNAME] [char] (64) NOT NULL ,
	[CN_TEMPTABLENAME] [char] (64) NOT NULL ,
	[CN_TABLETYPE] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPSTEP] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_NAME] [char] (64) NOT NULL ,
	[CN_DESCRIBE] [varchar] (128) NULL ,
	[CN_ALLOT_TYPE] [int] NOT NULL ,
	[CN_ALLOT_INFO] [char] (64) NOT NULL ,
	[CN_CARDNAME] [char] (64) NOT NULL ,
	[CN_DEFMAINCARDS] [char] (32) NOT NULL ,
	[CN_AUDITLIST] [varchar] (128) NOT NULL ,
	[CN_WORKUSER] [varchar] (128) NOT NULL ,
	[CN_ORDER] [int] NOT NULL ,
	[CN_CODE] [char] (64) NULL ,
	[CN_KIND] [char] (64) NULL ,
	[CN_ALIAS] [char] (10) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPUNIT] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_NAME] [char] (64) NOT NULL ,
	[CN_DESCRIBE] [varchar] (128) NULL ,
	[CN_CREATE_BY] [int] NOT NULL ,
	[CN_CREATE_DATE] [datetime] NOT NULL ,
	[CN_CAPPTABNAME] [char] (32) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CAPPUSERFIELDS] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_FIELDNAME] [char] (30) NULL ,
	[CN_SIZE] [int] NULL ,
	[CN_FIELDTYPE] [int] NULL ,
	[CN_TABLENAME] [char] (128) NULL ,
	[CN_DISTYPE] [int] NULL ,
	[CN_NODISZERO] [bit] NULL ,
	[CN_INHERITPRVDATA] [bit] NULL ,
	[CN_NODISINVALIDZERO] [bit] NULL ,
	[CN_PRECISION] [int] NULL ,
	[CN_INDEX] [int] NULL ,
	[CN_DEFAULT] [char] (40) NULL ,
	[CN_DATA] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CARDDATA_BLOB] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_COMPRESSED] [bit] NOT NULL ,
	[CN_BLOB] [image] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CARDVAR] (
	[CN_VARNAME] [char] (64) NOT NULL ,
	[CN_SEAT] [int] NOT NULL ,
	[CN_SEATNAME] [char] (64) NOT NULL ,
	[CN_DATATYPE] [int] NOT NULL ,
	[CN_SIZE] [int] NOT NULL ,
	[CN_NODISZERO] [bit] NOT NULL ,
	[CN_INHERITPRVDATA] [bit] NOT NULL ,
	[CN_NODISINVALIDZERO] [bit] NOT NULL ,
	[CN_PRECISION] [int] NOT NULL ,
	[CN_DISTYPE] [int] NOT NULL ,
	[CN_INDEX] [int] NOT NULL ,
	[CN_CARDID] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CLASSOBJ_PROPERTY] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_CLASSID] [int] NOT NULL ,
	[CN_PROPERTYNAME] [char] (128) NOT NULL ,
	[CN_PROPERTYTYPE] [int] NOT NULL ,
	[CN_PROPERTYSIZE] [int] NOT NULL ,
	[CN_ISROUTE] [bit] NOT NULL ,
	[CN_OUTVAR] [char] (128) NOT NULL ,
	[CN_ISCODE] [bit] NOT NULL ,
	[CN_ISTEXT] [bit] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_CUSTSYMBOL] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_NAME] [char] (40) NOT NULL ,
	[CN_ISFOLDER] [bit] NOT NULL ,
	[CN_GUID] [char] (40) NULL ,
	[CN_PARENTID] [int] NOT NULL ,
	[CN_BLOBID] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_DBVER] (
	[CN_VER] [char] (10) NOT NULL ,
	[CN_DATE] [datetime] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_DEFAULT_PROPERTY] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_PROPERTYNAME] [char] (64) NOT NULL ,
	[CN_PROPERTYVALUE] [char] (128) NOT NULL ,
	[CN_FIELDTYPE] [int] NOT NULL ,
	[CN_ISSELED] [bit] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_EVENT] (
	[CN_NAME] [char] (60) NULL ,
	[CN_SCRIPT] [varchar] (1024) NULL ,
	[CN_TYPE] [int] NULL ,
	[CN_OWNER] [varchar] (1024) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_FINOBJ] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_NAME] [char] (64) NOT NULL ,
	[CN_BLOBID] [int] NOT NULL ,
	[CN_CREATE_NAME] [char] (10) NOT NULL ,
	[CN_CREATE_DATE] [datetime] NOT NULL ,
	[CN_PLANEND_DATE] [datetime] NOT NULL ,
	[CN_REALEND_DATE] [datetime] NOT NULL ,
	[CN_MAINCARDS] [varchar] (1024) NOT NULL ,
	[CN_REMARK] [varchar] (64) NULL ,
	[KEY_OWNERNAME] [char] (64) NULL ,
	[KEY_OWNERCODE] [char] (64) NULL ,
	[KEY_VER] [char] (64) NULL ,
	[KEY_FEATURE] [char] (64) NULL ,
	[CN_LOCKUSER_ID] [int] NULL ,
	[CN_LOCKUSER_NAME] [char] (10) NULL ,
	[CN_PAGECOUNT] [int] NULL ,
	[KEY_EXT] [varchar] (50) NULL ,
	[KEY_OWNERVER] [char] (64) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_FINOBJ_BLOB] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_COMPRESSED] [bit] NOT NULL ,
	[CN_BLOB] [image] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_FREETASK] (
	[CN_PRODUCT_KIND] [char] (64) NULL ,
	[CN_PRODUCT_NAME] [char] (64) NULL ,
	[CN_PART_CODE] [char] (64) NULL ,
	[CN_PART_NAME] [char] (64) NULL ,
	[CN_MATERIAL_MARK] [char] (64) NULL ,
	[CN_CREATE_DATE] [datetime] NULL ,
	[CN_CREATE_BY] [int] NULL ,
	[CN_NOTE] [varchar] (128) NULL ,
	[CN_BLOBID] [int] NULL ,
	[CN_STATE] [int] NULL ,
	[CN_CAPPID] [int] NULL ,
	[CN_END_DATE] [datetime] NULL ,
	[CN_REALEND_DATE] [datetime] NULL ,
	[CN_RENOTE] [varchar] (50) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_IDI] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_NAME] [char] (20) NOT NULL ,
	[CN_DESCRIBE] [char] (60) NULL ,
	[CN_IDITABLENAME] [char] (30) NOT NULL ,
	[CN_ISFOLDER] [bit] NOT NULL ,
	[CN_PARENTID] [int] NOT NULL ,
	[CN_SIZEINFO] [char] (100) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_LEAVEACT] (
	[CN_CAPPOBJID] [int] NULL ,
	[CN_SYS_OBJCODE] [char] (64) NULL ,
	[CN_DATE] [datetime] NULL ,
	[CN_TYPE] [int] NULL ,
	[CN_CONTENT] [varchar] (1024) NULL ,
	[CN_OWNER] [char] (20) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_LEAVEACT_LOG] (
	[CN_CAPPOBJID] [int] NULL ,
	[CN_SYS_OBJCODE] [char] (64) NULL ,
	[CN_DATE] [datetime] NULL ,
	[CN_TYPE] [int] NULL ,
	[CN_CONTENT] [varchar] (1024) NULL ,
	[CN_OWNER] [char] (20) NULL ,
	[CN_EXCUTOR_TYPE] [int] NULL ,
	[CN_EXCUTOR_DATE] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_LISTDATA] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_TABLENAME] [char] (60) NOT NULL ,
	[CN_RECORDID] [int] NOT NULL ,
	[CN_FIELDID] [int] NOT NULL ,
	[CN_IDIDATAID] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_LU] (
	[CN_CN] [char] (64) NOT NULL ,
	[CN_IP] [char] (64) NOT NULL ,
	[CN_LIT] [char] (64) NOT NULL ,
	[CN_LOT] [char] (64) NOT NULL ,
	[CN_SN] [int] NOT NULL ,
	[CN_UN] [char] (64) NOT NULL ,
	[CN_LN] [char] (64) NOT NULL ,
	[CN_TP] [char] (64) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_MATERIAL] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_NAME] [char] (128) NULL ,
	[CN_DENSITY] [float] NULL ,
	[CN_PARENTID] [int] NULL ,
	[CN_DATAORDER] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_MATERIAL_FOLDER] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_NAME] [char] (64) NULL ,
	[CN_PARENTID] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_MEASURE] (
	[CN_FORMAT] [char] (128) NULL ,
	[CN_EXPRESS] [char] (128) NULL ,
	[CN_DATAORDER] [int] NULL ,
	[CN_PARENTID] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_MEASURE_FOLDER] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_NAME] [char] (128) NULL ,
	[CN_PARENTID] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_MEDISTAS] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_CARDID] [int] NULL ,
	[CN_NAME] [char] (64) NULL ,
	[CN_TABLENAME] [char] (64) NULL ,
	[CN_MAINCARDCODE] [int] NULL ,
	[CN_CURCARDCODE] [int] NULL ,
	[CN_HAVEMD] [bit] NOT NULL ,
	[CN_MDNAME] [char] (64) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_MEDISTAS_R] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_FIELDNAME] [char] (64) NULL ,
	[CN_CARDVARNAME] [char] (64) NULL ,
	[CN_VARSEAT] [int] NULL ,
	[CN_ISTOTAL] [bit] NOT NULL ,
	[CN_FIELDTYPE] [int] NULL ,
	[CN_LENGTH] [int] NULL ,
	[CN_MEDIID] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_MGR_CAPPCARD] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_NAME] [char] (64) NOT NULL ,
	[CN_FILENAME] [char] (64) NOT NULL ,
	[CN_BLOBID] [int] NOT NULL ,
	[CN_PUTINDATE] [datetime] NULL ,
	[CN_CARDID] [int] NOT NULL ,
	[CN_CARDOBJID] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_MGRBLOB] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_COMPRESSED] [bit] NOT NULL ,
	[CN_BLOB] [image] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_OUTPUTFIELD] (
	[CN_MAINCARDID] [int] NOT NULL ,
	[CN_CELLSEAT] [int] NOT NULL ,
	[CN_MDID] [int] NOT NULL ,
	[CN_FIELDNAME] [char] (64) NOT NULL ,
	[CN_SUM] [bit] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_OUTVARREL] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_OUTVAR] [char] (64) NOT NULL ,
	[CN_CLASSNAME] [char] (64) NOT NULL ,
	[CN_FORMAT] [char] (128) NOT NULL ,
	[CN_ISUP] [bit] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_PAGEINFO] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_COMPRESSED] [bit] NOT NULL ,
	[CN_BLOB] [image] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_PROCESSVARREL] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_OUTVAR] [char] (64) NOT NULL ,
	[CN_CLASSNAME] [char] (64) NOT NULL ,
	[CN_FORMAT] [char] (128) NOT NULL ,
	[CN_ISUP] [bit] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_PROJECTTREE_ITEMTYPE] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_PRJNODE_ITEMTYPE] [int] NOT NULL ,
	[CN_PRJNODE_PROPNAME] [char] (256) NOT NULL ,
	[CN_PRJNODE_DEFAULT] [char] (512) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_PURVIEW] (
	[CN_ID] [int] NOT NULL ,
	[CN_PURVIEW] [char] (64) NOT NULL ,
	[CN_USERTYPE] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_SC] (
	[CN_US] [char] (64) NULL ,
	[CN_LS] [char] (64) NULL ,
	[CN_TP] [char] (64) NULL ,
	[CN_RT] [char] (64) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_SCRIPT] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_NAME] [char] (64) NOT NULL ,
	[CN_ISFOLDER] [bit] NULL ,
	[CN_BLOBID] [int] NULL ,
	[CN_PARENTID] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_SCRIPT_BLOB] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_COMPRESSED] [bit] NOT NULL ,
	[CN_BLOB] [image] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_STAT_OBJ] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_NAME] [char] (64) NULL ,
	[CN_PARENTID] [int] NULL ,
	[CN_ISFOLDER] [bit] NULL ,
	[CN_BLOBID] [int] NULL ,
	[CN_DESCRIPTION] [char] (64) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_STAT_PICKUP] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_NAME] [char] (64) NULL ,
	[CN_PARENTID] [int] NULL ,
	[CN_ISFOLDER] [bit] NULL ,
	[CN_BLOBID] [int] NULL ,
	[CN_DESCRIPTION] [char] (64) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_STAT_TEMPTB] (
	[CN_TABNAME] [char] (64) NOT NULL ,
	[CN_DESCRIPTION] [char] (64) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_STAT_TEMPTBLOCKER] (
	[CN_COMSET] [char] (64) NULL ,
	[CN_NAME] [char] (64) NULL ,
	[CN_USERNAME] [char] (64) NULL ,
	[CN_IP] [char] (64) NULL ,
	[CN_TIME] [datetime] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_STATOUTVAR] (
	[CN_OUTVARNAME] [char] (64) NOT NULL ,
	[CN_TYPE] [int] NOT NULL ,
	[CN_SIZE] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_SUBCARDINFO] (
	[CN_MID_ID] [int] NOT NULL ,
	[CN_ROWOBJ_ID] [int] NOT NULL ,
	[CN_SUBCARDID] [int] NOT NULL ,
	[CN_SUBCARD_OBJID] [int] NOT NULL ,
	[CN_HEADDATAID] [int] NOT NULL ,
	[CN_INDEX] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_TASK_ATTACHMENT_BLOB] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_COMPRESSED] [bit] NOT NULL ,
	[CN_BLOB] [image] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_TASK_BLOB] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_COMPRESSED] [bit] NOT NULL ,
	[CN_BLOB] [image] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_TASK_PRJ] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_ISFOLDER] [bit] NULL ,
	[CN_NAME] [char] (64) NULL ,
	[CN_PARENTID] [int] NULL ,
	[CN_BLOBID] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_TEMPIDIDATA] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_IDIID] [int] NULL ,
	[CN_USERNAME] [char] (10) NULL ,
	[CN_DATETIME] [datetime] NULL ,
	[CN_DATA] [varchar] (1024) NULL ,
	[CN_FOLDERID] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_TEMPLATE_STRUDESCRIBE] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_TEMPLATENAME] [char] (128) NULL ,
	[CN_STRUINFO] [char] (128) NULL ,
	[CN_ALLFUN] [char] (128) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_TYPEAUDIT] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_PARENTID] [int] NOT NULL ,
	[CN_NAME] [char] (64) NOT NULL ,
	[CN_DESCRIBE] [varchar] (128) NULL ,
	[CN_ISFOLDER] [bit] NOT NULL ,
	[CN_USERID] [int] NOT NULL ,
	[CN_USED_NUM] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_TYPEAUDIT_STEP] (
	[CN_TYPEAUDIT_ID] [int] NOT NULL ,
	[CN_ORDER] [int] NOT NULL ,
	[CN_WORKNAME] [char] (64) NOT NULL ,
	[CN_WORKUSER] [varchar] (128) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_TYPECARD] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_PARENTID] [int] NOT NULL ,
	[CN_BLOBID] [int] NOT NULL ,
	[CN_NAME] [char] (128) NOT NULL ,
	[CN_ISFOLDER] [bit] NOT NULL ,
	[产品名称] [char] (64) NULL ,
	[零件名称] [char] (64) NULL ,
	[材料牌号] [char] (64) NULL ,
	[零件图号] [char] (64) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_TYPECARD_BLOB] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_COMPRESSED] [bit] NOT NULL ,
	[CN_BLOB] [image] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_TYPECARD_FOLDER] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_NAME] [char] (64) NULL ,
	[CN_ISFOLDER] [bit] NULL ,
	[CN_PARENTID] [int] NULL ,
	[CN_HAVESUB] [bit] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_TYPECARD_OBJ] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_NAME] [char] (64) NOT NULL ,
	[CN_PARENTID] [int] NOT NULL ,
	[KEY_FEATURE] [char] (64) NULL ,
	[KEY_OWNERNAME] [char] (64) NULL ,
	[KEY_OWNERCODE] [char] (64) NULL ,
	[CN_BLOBID] [int] NULL ,
	[CN_CONFIRMED] [int] NULL ,
	[hmmmmmmmmmm] [int] NULL ,
	[t65] [float] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_TYPECARD_PROPERTY] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_CARDID] [int] NULL ,
	[CN_CARDPROPERTY] [char] (64) NULL ,
	[CN_PROPERTYVALUE] [char] (64) NULL ,
	[CN_FIELDTYPE] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_TYPECARDFOLDER] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_FOLDERNAME] [char] (64) NULL ,
	[CN_PARENTID] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_TYPEFOLDER] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_NAME] [char] (64) NOT NULL ,
	[CN_PARENTID] [int] NOT NULL ,
	[CN_TYPENAME] [char] (64) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_TYPEROW] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_NAME] [char] (64) NOT NULL ,
	[CN_DESCRIPTION] [char] (128) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_TYPEROW_ENTRY] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_CARDID] [int] NULL ,
	[CN_CARD_TEMPLATE] [char] (256) NULL ,
	[CN_MIDDLE_TABLE] [char] (256) NULL ,
	[CN_DEPOT] [char] (256) NULL ,
	[CN_RULE] [char] (256) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_TYPEROW_NEWOBJ_LOG] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_CATEGORY] [char] (128) NULL ,
	[CN_OPERATION] [char] (128) NULL ,
	[CN_OPERATOR] [char] (128) NULL ,
	[CN_TIME] [datetime] NULL ,
	[CN_OBJ_CONTEXT] [char] (256) NULL ,
	[CN_OBJ_ID] [int] NULL ,
	[CN_ADDITIONAL] [char] (512) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_TYPEROW_RULE] (
	[CN_RULENAME] [char] (64) NOT NULL ,
	[CN_BASENAME] [char] (64) NOT NULL ,
	[CN_FIELDNAME] [char] (64) NOT NULL ,
	[CN_CARDVAR] [char] (64) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_TYPEROWFOLDER] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_PARENTID] [int] NULL ,
	[CN_NAME] [char] (64) NULL ,
	[CN_TABLENAME] [char] (64) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_USER_CAPPUNIT_R] (
	[CN_CAPPUNIT_ID] [int] NOT NULL ,
	[CN_USER_ID] [int] NOT NULL ,
	[CN_ISLEAD] [bit] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_USERPOPEDEMINFO] (
	[CN_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[CN_USERNAME] [char] (64) NOT NULL ,
	[CN_POPEDEMINFO] [char] (128) NOT NULL ,
	[CN_ALLFUN] [char] (128) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TN_SYS_WORKSTEP] (
	[CN_NAME] [char] (64) NOT NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[TN_SYS_ALLTYPETECHNICIS] WITH NOCHECK ADD 
	CONSTRAINT [PK_TN_SYS_ALLTYPETECHNICIS] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_APPTYPE] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_APPTYPE_CN_APPTYPE] DEFAULT (' ') FOR [CN_APPTYPE],
	CONSTRAINT [DF_TN_SYS_APPTYPE_CN_DESCRIBE] DEFAULT (' ') FOR [CN_DESCRIBE],
	CONSTRAINT [PK_TN_SYS_APPTYPE] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_APPTYPE]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_AUDIT] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_AUDIT_CN_NAME] DEFAULT (' ') FOR [CN_NAME]
GO

ALTER TABLE [dbo].[TN_SYS_BASERULE] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_BASERULE_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_BASERULE_CN_BASENAME] DEFAULT (' ') FOR [CN_BASENAME],
	CONSTRAINT [DF_TN_SYS_BASERULE_CN_BASEFIELD] DEFAULT (' ') FOR [CN_BASEFIELD],
	CONSTRAINT [DF_TN_SYS_BASERULE_CN_CARDVAR] DEFAULT (' ') FOR [CN_CARDVAR]
GO

ALTER TABLE [dbo].[TN_SYS_CAPPALLOT] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_FLOW_CN_CAPPBOMID] DEFAULT (0) FOR [CN_CAPPID],
	CONSTRAINT [DF_TN_SYS_FLOW_CN_ALLOTTYPE] DEFAULT (0) FOR [CN_ALLOT_TYPE],
	CONSTRAINT [DF_TN_SYS_FLOW_CN_DESTID] DEFAULT (' ') FOR [CN_ALLOT_INFO],
	CONSTRAINT [DF_TN_SYS_FLOW_CN_STEPID] DEFAULT (0) FOR [CN_STEPID],
	CONSTRAINT [DF_TN_SYS_CAPPALLOT_CN_CAPPOBJID] DEFAULT (0) FOR [CN_CAPPOBJID]
GO

ALTER TABLE [dbo].[TN_SYS_CAPPBLOB] WITH NOCHECK ADD 
	CONSTRAINT [PK_TN_SYS_CAPPBLOB] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CAPPBOM] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CAPPBOM_CN_STRUINFO] DEFAULT (' ') FOR [CN_STRUINFO],
	CONSTRAINT [DF_TN_SYS_CAPPBOM_CN_PRODUCT_KIND] DEFAULT (' ') FOR [CN_PRODUCT_KIND],
	CONSTRAINT [DF_TN_SYS_CAPPBOM_CN_PRODUCT_NAME] DEFAULT (' ') FOR [CN_PRODUCT_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPBOM_CN_PART_CODE] DEFAULT (' ') FOR [CN_PART_CODE],
	CONSTRAINT [DF_TN_SYS_CAPPBOM_CN_PART_NAME] DEFAULT (' ') FOR [CN_PART_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPBOM_CN_MASTERMARK] DEFAULT (' ') FOR [CN_MATERIAL_MARK],
	CONSTRAINT [DF_TN_SYS_CAPPBOM_CN_PART_CLASSID] DEFAULT (0) FOR [CN_PART_CLASSID],
	CONSTRAINT [DF_TN_SYS_CAPPBOM_CN_PART_OBJIDT] DEFAULT (0) FOR [CN_PART_OBJID],
	CONSTRAINT [DF_TN_SYS_CAPPBOM_CN_PART_VERSION] DEFAULT (' ') FOR [CN_PART_VERSION],
	CONSTRAINT [DF_TN_SYS_CAPPBOM_CN_MATERIAL_ID_1] DEFAULT (0) FOR [CN_MATERIAL_ID],
	CONSTRAINT [DF_TN_SYS_CAPPBOM_CN_CREATE_NAME] DEFAULT (' ') FOR [CN_CREATE_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPBOM_CN_CREATE_DATE_1] DEFAULT (getdate()) FOR [CN_CREATE_DATE],
	CONSTRAINT [DF_TN_SYS_CAPPBOM_CN_GROUPNAME_1] DEFAULT (' ') FOR [CN_GROUPNAME],
	CONSTRAINT [DF_TN_SYS_CAPPBOM_CN_NOTE_1] DEFAULT (' ') FOR [CN_NOTE],
	CONSTRAINT [PK_TN_SYS_CAPPBOM] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CAPPCARD] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CAPPCARD_CN_CARDTYPE] DEFAULT (0) FOR [CN_CARDTYPE],
	CONSTRAINT [DF_TN_SYS_CAPPCARD_CN_DEFFILE_BLOBID] DEFAULT (0) FOR [CN_DEFFILE_BLOBID],
	CONSTRAINT [DF_TN_SYS_CAPPCARD_CN_INDEXTABNAME] DEFAULT (' ') FOR [CN_INDEXTBNAME],
	CONSTRAINT [DF_TN_SYS_CAPPCARD_CN_INDEXTABNAME_TYPICE] DEFAULT (' ') FOR [CN_INDEXTBNAME_TYPICAL],
	CONSTRAINT [DF_TN_SYS_CAPPCARD_CN_ISFOLDER] DEFAULT (0) FOR [CN_ISFOLDER],
	CONSTRAINT [DF_TN_SYS_CAPPCARD_CN_PARENTID] DEFAULT (0) FOR [CN_PARENTID],
	CONSTRAINT [DF_TN_SYS_CAPPCARD_CN_DEFAULT] DEFAULT (0) FOR [CN_DEFAULT],
	CONSTRAINT [DF_TN_SYS_CAPPCARD_CN_ISDELETE] DEFAULT (0) FOR [CN_ISDELETE],
	CONSTRAINT [PK_TN_SYS_CAPPCARD] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CAPPCARD_REL] WITH NOCHECK ADD 
	CONSTRAINT [DF_CN_SYS_CAPPCARD_REL_CN_MASTER_CARDID] DEFAULT (' ') FOR [CN_MASTER_CARDNAME],
	CONSTRAINT [DF_CN_SYS_CAPPCARD_REL_CN_SECOND_CARDID] DEFAULT (' ') FOR [CN_SECOND_CARDNAME],
	CONSTRAINT [DF_CN_SYS_CAPPCARD_REL_CN_REL] DEFAULT (0) FOR [CN_REL],
	CONSTRAINT [DF_TN_SYS_CAPPCARD_REL_CN_INDEX] DEFAULT (1) FOR [CN_ORDER],
	CONSTRAINT [DF_TN_SYS_CAPPCARD_REL_CN_ISDEFAULT] DEFAULT (0) FOR [CN_ISDEFAULT],
	CONSTRAINT [DF_TN_SYS_CAPPCARD_REL_CN_ISDELETE] DEFAULT (0) FOR [CN_ISDELETE]
GO

ALTER TABLE [dbo].[TN_SYS_CAPPCARD_SUBTABINFO] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CAPPCARD_SUBTABINFO_CN_CARDID] DEFAULT (' ') FOR [CN_CARDNAME],
	CONSTRAINT [DF_TN_SYS_CAPPCARD_SUBTABINFO_CN_TABLENAME] DEFAULT (' ') FOR [CN_TABLENAME],
	CONSTRAINT [DF_TN_SYS_CAPPCARD_SUBTABINFO_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPCARD_SUBTABINFO_CN_TYPE] DEFAULT (0) FOR [CN_TYPE],
	CONSTRAINT [DF_TN_SYS_CAPPCARD_SUBTABINFO_CN_TYPEEX] DEFAULT (0) FOR [CN_TYPEEX]
GO

ALTER TABLE [dbo].[TN_SYS_CAPPCARDMD] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CAPPCARDMD_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPCARDMD_CN_DESCRIBE] DEFAULT (' ') FOR [CN_DESCRIBE],
	CONSTRAINT [DF_TN_SYS_CAPPCARDMD_CN_CARDID] DEFAULT (0) FOR [CN_CARDID],
	CONSTRAINT [DF_TN_SYS_CAPPCARDMD_CN_MDTYPE] DEFAULT (0) FOR [CN_MDTYPE],
	CONSTRAINT [DF_TN_SYS_CAPPCARDMD_CN_SOURCEMD] DEFAULT (' ') FOR [CN_SOURCEMD],
	CONSTRAINT [PK_TN_SYS_CAPPCARDMD] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CAPPCARDSUBTABLE] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CAPPMIDDATA_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPMIDDATA_CN_DESCRIBE] DEFAULT (' ') FOR [CN_DESCRIBE],
	CONSTRAINT [DF_TN_SYS_CAPPMIDDATA_CN_CARDID] DEFAULT (0) FOR [CN_CARDID],
	CONSTRAINT [DF_TN_SYS_CAPPMIDDATA_CN_TABLENAME] DEFAULT (' ') FOR [CN_TABLENAME],
	CONSTRAINT [DF_TN_SYS_CAPPMIDDATA_CN_TABETYPE] DEFAULT (0) FOR [CN_TABLETYPE],
	CONSTRAINT [PK_TN_SYS_CAPPMIDDATA] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CAPPCENTER] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CAPPCENTER_CN_BOMID] DEFAULT (0) FOR [CN_BOMID],
	CONSTRAINT [DF_TN_SYS_CAPPCENTER_CN_VERSION] DEFAULT (' ') FOR [CN_VERSION],
	CONSTRAINT [DF_TN_SYS_CAPPCENTER_CN_ISACTIVE] DEFAULT (0) FOR [CN_ISACTIVE],
	CONSTRAINT [DF_TN_SYS_CAPPCENTER_CN_CAPPSTATE] DEFAULT (0) FOR [CN_CAPPSTATE],
	CONSTRAINT [DF_TN_SYS_CAPPCENTER_CN_ISMODIFY] DEFAULT (0) FOR [CN_ISMODIFY],
	CONSTRAINT [DF_TN_SYS_CAPPCENTER_CN_CREATE_NAME] DEFAULT (' ') FOR [CN_CREATE_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPCENTER_CN_CREATE_DATE] DEFAULT (getdate()) FOR [CN_CREATE_DATE],
	CONSTRAINT [DF_TN_SYS_CAPPCENTER_CN_END_DATE] DEFAULT (getdate()) FOR [CN_END_DATE],
	CONSTRAINT [DF_TN_SYS_CAPPCENTER_CN_REALEND_DATE] DEFAULT (getdate()) FOR [CN_REALEND_DATE],
	CONSTRAINT [DF_TN_SYS_CAPPCENTER_CN_CAPPFLOW] DEFAULT (' ') FOR [CN_CAPPFLOW],
	CONSTRAINT [DF_TN_SYS_CAPPCENTER_CN_ALLOT_USERID] DEFAULT (0) FOR [CN_ALLOT_USERID],
	CONSTRAINT [DF_TN_SYS_CAPPCENTER_CN_DOCLIST] DEFAULT (' ') FOR [CN_DOCLIST],
	CONSTRAINT [DF_TN_SYS_CAPPCENTER_CN_NOTE] DEFAULT (' ') FOR [CN_NOTE],
	CONSTRAINT [DF_TN_SYS_CAPPCENTER_CN_HAVECARD] DEFAULT (0) FOR [CN_HAVECARD],
	CONSTRAINT [PK_TN_SYS_CAPPCENTER] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CAPPCODESEGMENT] WITH NOCHECK ADD 
	CONSTRAINT [PK_TN_SYS_CAPPCODESEGMENT] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_CODESEGMENT_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CAPPCODEVALUE] WITH NOCHECK ADD 
	CONSTRAINT [PK_TN_SYS_CAPPCODEVALUE] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_CODESEGMENT_VALUE],
		[CN_CODESEGMENT_ID],
		[CN_RULE_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CAPPMAIL] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CAPPMAIL_CN_TOPIC] DEFAULT (' ') FOR [CN_TOPIC],
	CONSTRAINT [DF_TN_SYS_CAPPMAIL_CN_DATA] DEFAULT (' ') FOR [CN_DATA],
	CONSTRAINT [DF_TN_SYS_CAPPMAIL_CN_SEND_USERID] DEFAULT (0) FOR [CN_SEND_USERID],
	CONSTRAINT [DF_TN_SYS_CAPPMAIL_CN_SEND_USERNAME] DEFAULT (' ') FOR [CN_SEND_USERNAME],
	CONSTRAINT [DF_TN_SYS_CAPPMAIL_CN_INCEPT_USERID] DEFAULT (0) FOR [CN_INCEPT_USERID],
	CONSTRAINT [DF_TN_SYS_CAPPMAIL_CN_INCEPT_USERNAME] DEFAULT (' ') FOR [CN_INCEPT_USERNAME],
	CONSTRAINT [DF_TN_SYS_CAPPMAIL_CN_SEND_DATE] DEFAULT (getdate()) FOR [CN_SEND_DATE],
	CONSTRAINT [DF_TN_SYS_CAPPMAIL_CN_AFFIXDOC_NAME] DEFAULT (' ') FOR [CN_AFFIXDOC_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPMAIL_CN_AFFIXDOC_ID] DEFAULT (' ') FOR [CN_AFFIXDOC_ID],
	CONSTRAINT [DF_TN_SYS_CAPPMAIL_CN_STATE] DEFAULT (1) FOR [CN_STATE],
	CONSTRAINT [DF_TN_SYS_CAPPMAIL_CN_MAZHIFENG] DEFAULT (1) FOR [CN_BLEVELHIGH],
	CONSTRAINT [DF_TN_SYS_CAPPMAIL_CN_OBJID] DEFAULT (0) FOR [CN_OBJID],
	CONSTRAINT [DF_TN_SYS_CAPPMAIL_CN_FOLDERID] DEFAULT (0) FOR [CN_GROUPID],
	CONSTRAINT [DF_TN_SYS_CAPPMAIL_CN_OWNERID] DEFAULT (0) FOR [CN_OWNERID],
	CONSTRAINT [PK_TN_SYS_CAPPMAIL] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CAPPMAIL_BLOB] WITH NOCHECK ADD 
	CONSTRAINT [PK_TN_SYS_CAPPMAIL_BLOB] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CAPPMGR_BLOB] WITH NOCHECK ADD 
	CONSTRAINT [PK_TN_SYS_CAPPMGR_BLOB] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CAPPMGRCLASS] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CAPPMGRCLASS_CN_CLASSNAME] DEFAULT ('') FOR [CN_CLASSNAME],
	CONSTRAINT [DF_TN_SYS_CAPPMGRCLASS_CN_DISPFORMAT] DEFAULT ('') FOR [CN_DISPFORMAT],
	CONSTRAINT [DF_TN_SYS_CAPPMGRCLASS_CN_ISPRIMARY] DEFAULT (0) FOR [CN_ISPRIMARY],
	CONSTRAINT [DF_TN_SYS_CAPPMGRCLASS_CN_MARK] DEFAULT ('') FOR [CN_MARK],
	CONSTRAINT [DF_TN_SYS_CAPPMGRCLASS_CN_BLOBID] DEFAULT (0) FOR [CN_BLOBID],
	CONSTRAINT [DF_TN_SYS_CAPPMGRCLASS_CN_ISDRAWING] DEFAULT (0) FOR [CN_ISDRAWING],
	CONSTRAINT [DF_TN_SYS_CAPPMGRCLASS_CN_ISFILLCAPP] DEFAULT (0) FOR [CN_ISFILLCAPP]
GO

ALTER TABLE [dbo].[TN_SYS_CAPPMGRCLASSREL] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CAPPMGRCLASSREL_CN_CLASSID] DEFAULT (0) FOR [CN_CLASSID],
	CONSTRAINT [DF_TN_SYS_CAPPMGRCLASSREL_CN_SUB_CLASSID] DEFAULT (0) FOR [CN_SUB_CLASSID],
	CONSTRAINT [PK_TN_SYS_CAPPMGRCLASSREL] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CAPPOBJ] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_CN_BLOBID] DEFAULT (0) FOR [CN_BLOBID],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_CN_CREATE_BY] DEFAULT (' ') FOR [CN_CREATE_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_CN_CREATE_DATE] DEFAULT (getdate()) FOR [CN_CREATE_DATE],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_CN_END_DATE] DEFAULT (getdate()) FOR [CN_PLANEND_DATE],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_CN_REALEND_DATE] DEFAULT (getdate()) FOR [CN_REALEND_DATE],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_CN_DEFMAINCARDS] DEFAULT (' ') FOR [CN_MAINCARDS],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_CN_REMARK] DEFAULT (' ') FOR [CN_REMARK],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_CN_KEY_NAME] DEFAULT (' ') FOR [KEY_OWNERNAME],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_CN_KEY_CODE] DEFAULT (' ') FOR [KEY_OWNERCODE],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_CN_KEY_VER] DEFAULT (' ') FOR [KEY_VER],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_CN_KEY_FEATURE] DEFAULT (' ') FOR [KEY_FEATURE],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_CN_LOCKUSER_ID] DEFAULT (0) FOR [CN_LOCKUSER_ID],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_CN_LOCKUSER_NAME] DEFAULT (' ') FOR [CN_LOCKUSER_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_CN_PAGECOUNT] DEFAULT (0) FOR [CN_PAGECOUNT],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_CN_KEY_EXT] DEFAULT (' ') FOR [KEY_EXT],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_CN_KEY_CAPPVER] DEFAULT (' ') FOR [KEY_OWNERVER],
	CONSTRAINT [PK_TN_SYS_CAPPOBJ] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CAPPOBJ_BLOB] WITH NOCHECK ADD 
	CONSTRAINT [PK_TN_SYS_CAPPOBJ_BLOB] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CAPPOBJ_INDEX] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_INDEX_CN_CAPPOBJ_ID] DEFAULT (0) FOR [CN_CAPPOBJ_ID],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_INDEX_CN_CAPPBOM_ID] DEFAULT (0) FOR [CN_CAPPBOM_ID],
	CONSTRAINT [PK_TN_SYS_CAPPOBJ_INDEX] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_CAPPOBJ_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CAPPOBJ_OUTINFO] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_OUTINFO_CN_KEY_NAME] DEFAULT (' ') FOR [KEY_OWNERNAME],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_OUTINFO_CN_KEY_CODE] DEFAULT (' ') FOR [KEY_OWNERCODE],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_OUTINFO_CN_KEY_VER] DEFAULT (' ') FOR [KEY_VER],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_OUTINFO_CN_KEY_EXT] DEFAULT (' ') FOR [KEY_EXT],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_OUTINFO_CN_KEY_FEATURE] DEFAULT (' ') FOR [KEY_FEATURE],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_OUTINFO_CN_EXT] DEFAULT (' ') FOR [CN_EXT]
GO

ALTER TABLE [dbo].[TN_SYS_CAPPOBJ_OUTPUTDATA] WITH NOCHECK ADD 
	CONSTRAINT [DF_CN_SYS_CAPPOBJ_OUTDATA_CN_CAPPOBJID] DEFAULT (0) FOR [CN_CAPPOBJID],
	CONSTRAINT [DF_CN_SYS_CAPPOBJ_OUTDATA_CN_CARDID] DEFAULT (' ') FOR [CN_CARDNAME],
	CONSTRAINT [DF_CN_SYS_CAPPOBJ_OUTDATA_CN_CARDCODE] DEFAULT (' ') FOR [CN_CARDCODE],
	CONSTRAINT [DF_CN_SYS_CAPPOBJ_OUTDATA_CN_DATA] DEFAULT (' ') FOR [CN_DATA]
GO

ALTER TABLE [dbo].[TN_SYS_CAPPOBJ_QUEUE_LOG] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_QUEUE_LOG_CN_CAPPOBJID] DEFAULT (0) FOR [CN_CAPPOBJID],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_QUEUE_LOG_CN_CARDNAME] DEFAULT ('') FOR [CN_CARDNAME],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_QUEUE_LOG_CN_OWNERNAME] DEFAULT ('') FOR [CN_OWNERNAME],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_QUEUE_LOG_CN_WONERCODE] DEFAULT ('') FOR [CN_WONERCODE],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_QUEUE_LOG_CN_ORDER] DEFAULT (0) FOR [CN_ORDER],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_QUEUE_LOG_CN_QUEUENAME] DEFAULT ('') FOR [CN_QUEUENAME],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_QUEUE_LOG_CN_USER_ID] DEFAULT (0) FOR [CN_USER_ID],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_QUEUE_LOG_CN_USER_NAME] DEFAULT ('') FOR [CN_USER_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_QUEUE_LOG_CN_USER_TYPE] DEFAULT (0) FOR [CN_USER_TYPE],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_QUEUE_LOG_CN_ASSISTER_ID] DEFAULT (0) FOR [CN_ASSISTER_ID],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_QUEUE_LOG_CN_ASSISTER_NAME] DEFAULT ('') FOR [CN_ASSISTER_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_QUEUE_LOG_CN_ASSISTER_TYPE] DEFAULT (0) FOR [CN_ASSISTER_TYPE],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_QUEUE_LOG_CN_EXT] DEFAULT ('') FOR [CN_EXT],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_QUEUE_LOG_CN_PLANEND_DATE] DEFAULT (getdate()) FOR [CN_PLANEND_DATE],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_QUEUE_LOG_CN_REALEND_DATE] DEFAULT (getdate()) FOR [CN_REALEND_DATE]
GO

ALTER TABLE [dbo].[TN_SYS_CAPPOBJ_SPECTATOR] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_SPECTATOR_CN_CAPPOBJID] DEFAULT (0) FOR [CN_CAPPOBJID],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_SPECTATOR_CN_ORDER] DEFAULT (0) FOR [CN_ORDER],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_SPECTATOR_CN_USER_ID] DEFAULT (0) FOR [CN_USER_ID],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_SPECTATOR_CN_USER_NAME] DEFAULT (0) FOR [CN_USER_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_SPECTATOR_CN_USER_TYPE] DEFAULT (0) FOR [CN_USER_TYPE]
GO

ALTER TABLE [dbo].[TN_SYS_CAPPOBJ_WORK] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_WORK_CN_CAPPOBJ_ID] DEFAULT (0) FOR [CN_CAPPOBJ_ID],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_WORK_CN_WORKTYPE] DEFAULT (0) FOR [CN_WORKTYPE],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_WORK_CN_WORKNAME] DEFAULT (' ') FOR [CN_WORKNAME],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_WORK_CN_WORKUSER] DEFAULT (' ') FOR [CN_WORKUSER]
GO

ALTER TABLE [dbo].[TN_SYS_CAPPOBJ_WORKINFO] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_WORKINFO_CN_CAPPOBJID] DEFAULT (0) FOR [CN_CAPPOBJID],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_WORKINFO_CN_WORKUSER_NAME] DEFAULT (' ') FOR [CN_WORKUSER_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_WORKINFO_CN_WORKUSER_ID] DEFAULT (0) FOR [CN_WORKUSER_ID],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_WORKINFO_CN_WORKUSER_TYPE] DEFAULT (0) FOR [CN_WORKUSER_TYPE],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_WORKINFO_CN_ASSISTER_NAME] DEFAULT (' ') FOR [CN_ASSISTER_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_WORKINFO_CN_ASSISTER_ID] DEFAULT (0) FOR [CN_ASSISTER_ID],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_WORKINFO_CN_ASSISTER_TYPE] DEFAULT (0) FOR [CN_ASSISTER_TYPE],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_WORKINFO_CN_WORKTYPE] DEFAULT (0) FOR [CN_WORKTYPE],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_WORKINFO_CN_WORKSTEPNAME] DEFAULT (' ') FOR [CN_WORKSTEPNAME],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_WORKINFO_CN_AUDIT] DEFAULT (' ') FOR [CN_AUDIT],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_WORKINFO_CN_EXT] DEFAULT (' ') FOR [CN_EXT],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_WORKINFO_CN_WORKCHANGSCRIPT] DEFAULT (' ') FOR [CN_WORKCHANGSCRIPT],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_WORKINFO_CN_CURWORKUSER_ID_1] DEFAULT (0) FOR [CN_CURWORKUSER_ID],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_WORKINFO_CN_CURWORKUSER_NAME_1] DEFAULT (' ') FOR [CN_CURWORKUSER_NAME]
GO

ALTER TABLE [dbo].[TN_SYS_CAPPOBJ_WORKQUEUE] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_ WORKQUEUE_CN_CAPPOBJID] DEFAULT (0) FOR [CN_CAPPOBJID],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_ WORKQUEUE_CN_ORDER] DEFAULT (0) FOR [CN_ORDER],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_ WORKQUEUE_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_ WORKQUEUE_CN_USER_ID] DEFAULT (0) FOR [CN_USER_ID],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_ WORKQUEUE_CN_USER_NAME] DEFAULT (' ') FOR [CN_USER_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_ WORKQUEUE_CN_USER_TYPE] DEFAULT (0) FOR [CN_USER_TYPE],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_ WORKQUEUE_CN_ASSISTER_ID] DEFAULT (0) FOR [CN_ASSISTER_ID],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_ WORKQUEUE_CN_ASSISTER_NAME] DEFAULT (' ') FOR [CN_ASSISTER_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_ WORKQUEUE_CN_ASSISTER_TYPE] DEFAULT (0) FOR [CN_ASSISTER_TYPE],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_ WORKQUEUE_CN_EXT] DEFAULT (' ') FOR [CN_EXT],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_WORKQUEUE_CN_REALEND_DATA] DEFAULT (getdate()) FOR [CN_REALEND_DATE],
	CONSTRAINT [DF_TN_SYS_CAPPOBJ_WORKQUEUE_CN_END_DATA] DEFAULT (getdate()) FOR [CN_PLANEND_DATE]
GO

ALTER TABLE [dbo].[TN_SYS_CAPPOUTVALUE] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CAPPOUTVALUE_CN_TASK_ID] DEFAULT (0) FOR [CN_SYS_CAPPBOMID],
	CONSTRAINT [DF__TN_SYS_CAP__零件图号__430CD787] DEFAULT (' ') FOR [零件图号],
	CONSTRAINT [DF__TN_SYS_CAP__零件名称__4400FBC0] DEFAULT (' ') FOR [零件名称],
	CONSTRAINT [DF__TN_SYS_CAP__材料牌号__45E94432] DEFAULT (' ') FOR [材料牌号],
	CONSTRAINT [DF__TN_SYS_CAP__产品型号__210CC53E] DEFAULT (' ') FOR [产品型号],
	CONSTRAINT [DF__TN_SYS_CAP__产品名称__2200E977] DEFAULT (' ') FOR [产品名称],
	CONSTRAINT [DF__TN_SYS_CA__所属装配件__511C966A] DEFAULT (' ') FOR [所属装配件图号],
	CONSTRAINT [DF_TN_SYS_CAPPOUTVALUE_所属装配件名称] DEFAULT (' ') FOR [所属装配件名称],
	CONSTRAINT [DF_TN_SYS_CAPPOUTVALUE_数量] DEFAULT (0) FOR [数量],
	CONSTRAINT [DF__TN_SYS_CAPP__aaa__18D83D47] DEFAULT (' ') FOR [aaa]
GO

ALTER TABLE [dbo].[TN_SYS_CAPPPRIVYINFO] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CAPPPRIVYMSGINFO_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPPRIVYMSGINFO_CN_MSGINFO] DEFAULT (' ') FOR [CN_INFO],
	CONSTRAINT [DF_TN_SYS_CAPPPRIVYINFO_CN_USERID] DEFAULT (0) FOR [CN_USERID],
	CONSTRAINT [DF_TN_SYS_CAPPPRIVYINFO_CN_INTINFO] DEFAULT (0) FOR [CN_INTINFO],
	CONSTRAINT [PK_TN_SYS_CAPPPRIVYINFO] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_NAME],
		[CN_USERID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CAPPRPTBLOB] WITH NOCHECK ADD 
	CONSTRAINT [PK_TN_SYS_CAPPRPTBLOB] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CAPPRULE] WITH NOCHECK ADD 
	CONSTRAINT [PK_TN_SYS_CAPPRULE] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_RULE_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CAPPSEED] WITH NOCHECK ADD 
	CONSTRAINT [PK_TN_SYS_CAPPSEED] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_CODEVALUE]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CAPPSTAT] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CAPPSTAT_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPSTAT_CN_STATBLOBID] DEFAULT (0) FOR [CN_STATBLOBID]
GO

ALTER TABLE [dbo].[TN_SYS_CAPPSTATBIND] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CAPPSTATBIND_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPSTATBIND_CN_DISTYPE] DEFAULT (0) FOR [CN_DISTYPE],
	CONSTRAINT [DF_TN_SYS_CAPPSTATBIND_CN_STATOBJNAME] DEFAULT (' ') FOR [CN_STATOBJNAME],
	CONSTRAINT [DF_TN_SYS_CAPPSTATBIND_CN_STATMEANSNAME] DEFAULT (' ') FOR [CN_STATMEANSNAME],
	CONSTRAINT [DF_TN_SYS_CAPPSTATBIND_CN_DESCRIBE] DEFAULT (' ') FOR [CN_DESCRIBE],
	CONSTRAINT [DF_TN_SYS_CAPPSTATBIND_CN_MEANSWHERENAME] DEFAULT (' ') FOR [CN_MEANSWHERENAME],
	CONSTRAINT [DF_TN_SYS_CAPPSTATBIND_CN_WHERELEVE] DEFAULT (0) FOR [CN_DATAOUTTYPE],
	CONSTRAINT [PK_TN_SYS_CAPPSTATBIND] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CAPPSTEP] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CAPPSTEP_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_CAPPSTEP_CN_DESCRIBE] DEFAULT (' ') FOR [CN_DESCRIBE],
	CONSTRAINT [DF_TN_SYS_CAPPSTEP_CN_ALLOTTYPE] DEFAULT (0) FOR [CN_ALLOT_TYPE],
	CONSTRAINT [DF_TN_SYS_CAPPSTEP_CN_DESTID] DEFAULT (' ') FOR [CN_ALLOT_INFO],
	CONSTRAINT [DF_TN_SYS_CAPPSTEP_CN_CARDNAME] DEFAULT (' ') FOR [CN_CARDNAME],
	CONSTRAINT [DF_TN_SYS_CAPPSTEP_CN_CARDIDLIST] DEFAULT (' ') FOR [CN_DEFMAINCARDS],
	CONSTRAINT [DF_TN_SYS_CAPPSTEP_CN_AUDITLIST] DEFAULT (' ') FOR [CN_AUDITLIST],
	CONSTRAINT [DF_TN_SYS_CAPPSTEP_CN_CARDNAME1] DEFAULT (' ') FOR [CN_WORKUSER],
	CONSTRAINT [DF_TN_SYS_CAPPSTEP_CN_ORDER] DEFAULT (0) FOR [CN_ORDER],
	CONSTRAINT [DF_TN_SYS_CAPPSTEP_CN_CODE] DEFAULT (' ') FOR [CN_CODE],
	CONSTRAINT [DF_TN_SYS_CAPPSTEP_CN_KIND] DEFAULT (' ') FOR [CN_KIND],
	CONSTRAINT [DF_TN_SYS_CAPPSTEP_CN_ALIAS] DEFAULT (' ') FOR [CN_ALIAS],
	CONSTRAINT [PK_TN_SYS_CAPPSTEP] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CAPPUNIT] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_UNIT_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_UNIT_CN_DESCRIBE] DEFAULT (' ') FOR [CN_DESCRIBE],
	CONSTRAINT [DF_TN_SYS_UNIT_CN_CREATE_BY] DEFAULT (0) FOR [CN_CREATE_BY],
	CONSTRAINT [DF_TN_SYS_UNIT_CN_CREATE_DATE] DEFAULT ('2001-1-1 0:0') FOR [CN_CREATE_DATE],
	CONSTRAINT [DF_TN_SYS_UNIT_CN_CAPPTABNAME] DEFAULT (' ') FOR [CN_CAPPTABNAME],
	CONSTRAINT [PK_TN_SYS_UNIT] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CARDDATA_BLOB] WITH NOCHECK ADD 
	CONSTRAINT [PK_TN_SYS_CARDDATA_BLOB] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CARDVAR] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CARDVAR_CN_NAME] DEFAULT (' ') FOR [CN_VARNAME],
	CONSTRAINT [DF_TN_SYS_CARDVAR_CN_SEAT] DEFAULT (0) FOR [CN_SEAT],
	CONSTRAINT [DF_TN_SYS_CARDVAR_CN_MDNAME] DEFAULT (' ') FOR [CN_SEATNAME],
	CONSTRAINT [DF_TN_SYS_CARDVAR_CN_TYPE] DEFAULT (0) FOR [CN_DATATYPE],
	CONSTRAINT [DF_TN_SYS_CARDVAR_CN_SIZE] DEFAULT (0) FOR [CN_SIZE],
	CONSTRAINT [DF_TN_SYS_CARDVAR_CN_NODISZERO] DEFAULT (0) FOR [CN_NODISZERO],
	CONSTRAINT [DF_TN_SYS_CARDVAR_CN_INHERITPRVDATA] DEFAULT (0) FOR [CN_INHERITPRVDATA],
	CONSTRAINT [DF_TN_SYS_CARDVAR_CN_NODISINVALIDZERO] DEFAULT (0) FOR [CN_NODISINVALIDZERO],
	CONSTRAINT [DF_TN_SYS_CARDVAR_CN_PRECISION] DEFAULT (0) FOR [CN_PRECISION],
	CONSTRAINT [DF_TN_SYS_CARDVAR_CN_DISTYPE] DEFAULT (0) FOR [CN_DISTYPE],
	CONSTRAINT [DF_TN_SYS_CARDVAR_CN_INDEX] DEFAULT (0) FOR [CN_INDEX],
	CONSTRAINT [DF_TN_SYS_CARDVAR_CN_CARDID] DEFAULT (0) FOR [CN_CARDID],
	CONSTRAINT [PK_TN_SYS_CARDVAR] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_VARNAME],
		[CN_SEAT],
		[CN_SEATNAME],
		[CN_CARDID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_CLASSOBJ_PROPERTY] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_CLASSOBJ_PROPERTY_CN_CLASSID] DEFAULT (0) FOR [CN_CLASSID],
	CONSTRAINT [DF_TN_SYS_CLASSOBJ_PROPERTY_CN_PROPERTYNAME] DEFAULT ('') FOR [CN_PROPERTYNAME],
	CONSTRAINT [DF_TN_SYS_CLASSOBJ_PROPERTY_CN_PROPERTYTYPE] DEFAULT (0) FOR [CN_PROPERTYTYPE],
	CONSTRAINT [DF_TN_SYS_CLASSOBJ_PROPERTY_CN_PROPERTYSIZE] DEFAULT (0) FOR [CN_PROPERTYSIZE],
	CONSTRAINT [DF_TN_SYS_CLASSOBJ_PROPERTY_CN_ISROUTE] DEFAULT (0) FOR [CN_ISROUTE],
	CONSTRAINT [DF_TN_SYS_CLASSOBJ_PROPERTY_CN_OUTVAR] DEFAULT ('') FOR [CN_OUTVAR],
	CONSTRAINT [DF_TN_SYS_CLASSOBJ_PROPERTY_CN_ISCODE] DEFAULT (0) FOR [CN_ISCODE]
GO

ALTER TABLE [dbo].[TN_SYS_DBVER] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_DBVER_CN_VER] DEFAULT (' ') FOR [CN_VER],
	CONSTRAINT [DF_TN_SYS_DBVER_CN_DATE] DEFAULT (getdate()) FOR [CN_DATE]
GO

ALTER TABLE [dbo].[TN_SYS_EVENT] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_EVENT_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_EVENT_CN_SCRIPTNAME] DEFAULT (' ') FOR [CN_SCRIPT],
	CONSTRAINT [DF_TN_SYS_EVENT_CN_TYPE] DEFAULT (0) FOR [CN_TYPE],
	CONSTRAINT [DF_TN_SYS_EVENT_CN_OWNER] DEFAULT (' ') FOR [CN_OWNER]
GO

ALTER TABLE [dbo].[TN_SYS_FINOBJ] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_FINOBJ_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_FINOBJ_CN_BLOBID] DEFAULT (0) FOR [CN_BLOBID],
	CONSTRAINT [DF_TN_SYS_FINOBJ_CN_CREATE_BY] DEFAULT (' ') FOR [CN_CREATE_NAME],
	CONSTRAINT [DF_TN_SYS_FINOBJ_CN_CREATE_DATE] DEFAULT (getdate()) FOR [CN_CREATE_DATE],
	CONSTRAINT [DF_TN_SYS_FINOBJ_CN_END_DATE] DEFAULT (getdate()) FOR [CN_PLANEND_DATE],
	CONSTRAINT [DF_TN_SYS_FINOBJ_CN_REALEND_DATE] DEFAULT (getdate()) FOR [CN_REALEND_DATE],
	CONSTRAINT [DF_TN_SYS_FINOBJ_CN_DEFMAINCARDS] DEFAULT (' ') FOR [CN_MAINCARDS],
	CONSTRAINT [DF_TN_SYS_FINOBJ_CN_REMARK] DEFAULT (' ') FOR [CN_REMARK],
	CONSTRAINT [DF_TN_SYS_FINOBJ_CN_KEY_NAME] DEFAULT (' ') FOR [KEY_OWNERNAME],
	CONSTRAINT [DF_TN_SYS_FINOBJ_CN_KEY_CODE] DEFAULT (' ') FOR [KEY_OWNERCODE],
	CONSTRAINT [DF_TN_SYS_FINOBJ_CN_KEY_VER] DEFAULT (' ') FOR [KEY_VER],
	CONSTRAINT [DF_TN_SYS_FINOBJ_CN_KEY_FEATURE] DEFAULT (' ') FOR [KEY_FEATURE],
	CONSTRAINT [DF_TN_SYS_FINOBJ_CN_LOCKUSER_ID] DEFAULT (0) FOR [CN_LOCKUSER_ID],
	CONSTRAINT [DF_TN_SYS_FINOBJ_CN_LOCKUSER_NAME] DEFAULT (' ') FOR [CN_LOCKUSER_NAME],
	CONSTRAINT [DF_TN_SYS_FINOBJ_CN_PAGECOUNT] DEFAULT (0) FOR [CN_PAGECOUNT],
	CONSTRAINT [DF_TN_SYS_FINOBJ_CN_KEY_EXT] DEFAULT (' ') FOR [KEY_EXT],
	CONSTRAINT [DF_TN_SYS_FINOBJ_CN_KEY_CAPPVER] DEFAULT (' ') FOR [KEY_OWNERVER],
	CONSTRAINT [PK_TN_SYS_FINOBJ] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_FINOBJ_BLOB] WITH NOCHECK ADD 
	CONSTRAINT [PK_TN_SYS_FINOBJ_BLOB] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_FREETASK] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_FREETASK_CN_PRODUCT_KIND] DEFAULT (' ') FOR [CN_PRODUCT_KIND],
	CONSTRAINT [DF_TN_SYS_FREETASK_CN_PRODUCT_NAME] DEFAULT (' ') FOR [CN_PRODUCT_NAME],
	CONSTRAINT [DF_TN_SYS_FREETASK_CN_PART_CODE] DEFAULT (' ') FOR [CN_PART_CODE],
	CONSTRAINT [DF_TN_SYS_FREETASK_CN_PART_NAME] DEFAULT (' ') FOR [CN_PART_NAME],
	CONSTRAINT [DF_TN_SYS_FREETASK_CN_MATERIAL_MARK] DEFAULT (' ') FOR [CN_MATERIAL_MARK],
	CONSTRAINT [DF_TN_SYS_FREETASK_CN_CREATE_DATE] DEFAULT (getdate()) FOR [CN_CREATE_DATE],
	CONSTRAINT [DF_TN_SYS_FREETASK_CN_CREATE_BY] DEFAULT (0) FOR [CN_CREATE_BY],
	CONSTRAINT [DF_TN_SYS_FREETASK_CN_NOTE] DEFAULT (' ') FOR [CN_NOTE],
	CONSTRAINT [DF_TN_SYS_FREETASK_CN_BLOBID] DEFAULT (0) FOR [CN_BLOBID],
	CONSTRAINT [DF_TN_SYS_FREETASK_CN_STATE] DEFAULT (0) FOR [CN_STATE],
	CONSTRAINT [DF_TN_SYS_FREETASK_CN_CAPPID] DEFAULT (0) FOR [CN_CAPPID],
	CONSTRAINT [DF_TN_SYS_FREETASK_CN_END_DATE] DEFAULT (getdate()) FOR [CN_END_DATE],
	CONSTRAINT [DF_TN_SYS_FREETASK_CN_REALEND_DATE] DEFAULT (getdate()) FOR [CN_REALEND_DATE],
	CONSTRAINT [DF_TN_SYS_FREETASK_CN_RENOTE] DEFAULT (' ') FOR [CN_RENOTE]
GO

ALTER TABLE [dbo].[TN_SYS_IDI] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_IDI_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_IDI_CN_DESCRIBE] DEFAULT (' ') FOR [CN_DESCRIBE],
	CONSTRAINT [DF_TN_SYS_IDI_CN_IDITABLENAME] DEFAULT (' ') FOR [CN_IDITABLENAME],
	CONSTRAINT [DF_TN_SYS_IDI_CN_ISFOLDER] DEFAULT (0) FOR [CN_ISFOLDER],
	CONSTRAINT [DF_TN_SYS_IDI_ID_PARENTID] DEFAULT (0) FOR [CN_PARENTID],
	CONSTRAINT [DF_TN_SYS_IDI_CN_SIZEINFO] DEFAULT (' ') FOR [CN_SIZEINFO],
	CONSTRAINT [PK_TN_SYS_IDI] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_LEAVEACT] WITH NOCHECK ADD 
	CONSTRAINT [DF_CN_SYS_LEAVEACT_CN_DATE] DEFAULT (getdate()) FOR [CN_DATE],
	CONSTRAINT [DF_CN_SYS_LEAVEACT_CN_TYPE] DEFAULT (0) FOR [CN_TYPE]
GO

ALTER TABLE [dbo].[TN_SYS_LEAVEACT_LOG] WITH NOCHECK ADD 
	CONSTRAINT [DF_CN_SYS_LEAVEACT_LOG_CN_EXCUTOR_DATE] DEFAULT (getdate()) FOR [CN_EXCUTOR_DATE]
GO

ALTER TABLE [dbo].[TN_SYS_LISTDATA] WITH NOCHECK ADD 
	CONSTRAINT [PK_TN_SYS_LISTDATA] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_LU] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_LU_CN_CN] DEFAULT (' ') FOR [CN_CN],
	CONSTRAINT [DF_TN_SYS_LU_CN_IP] DEFAULT (' ') FOR [CN_IP],
	CONSTRAINT [DF_TN_SYS_LU_CN_LIT] DEFAULT (' ') FOR [CN_LIT],
	CONSTRAINT [DF_TN_SYS_LU_CN_LOT] DEFAULT (' ') FOR [CN_LOT],
	CONSTRAINT [DF_TN_SYS_LU_CN_SN] DEFAULT (0) FOR [CN_SN],
	CONSTRAINT [DF_TN_SYS_LU_CN_UN] DEFAULT (' ') FOR [CN_UN],
	CONSTRAINT [DF_TN_SYS_LU_CN_UI] DEFAULT (' ') FOR [CN_LN],
	CONSTRAINT [DF_TN_SYS_LU_CN_TP] DEFAULT (' ') FOR [CN_TP],
	CONSTRAINT [PK_TN_SYS_LU] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_LIT],
		[CN_LN],
		[CN_TP]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_MATERIAL] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_MATERIAL_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_MATERIAL_CN_DENSITY] DEFAULT (0) FOR [CN_DENSITY],
	CONSTRAINT [DF_TN_SYS_MATERIAL_CN_PARENTID] DEFAULT (0) FOR [CN_PARENTID],
	CONSTRAINT [DF_TN_SYS_MATERIAL_CN_DATAORDER] DEFAULT (0) FOR [CN_DATAORDER]
GO

ALTER TABLE [dbo].[TN_SYS_MATERIAL_FOLDER] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_MATERIAL_FOLDER_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_MATERIAL_FOLDER_CN_PARENTID] DEFAULT (0) FOR [CN_PARENTID],
	CONSTRAINT [PK_TN_SYS_MATERIAL_FOLDER] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_MEASURE] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_MEASURE_CN_FORMAT] DEFAULT (' ') FOR [CN_FORMAT],
	CONSTRAINT [DF_TN_SYS_MEASURE_CN_EXPRESS] DEFAULT (' ') FOR [CN_EXPRESS],
	CONSTRAINT [DF_TN_SYS_MEASURE_CN_DATAORDER] DEFAULT (0) FOR [CN_DATAORDER],
	CONSTRAINT [DF_TN_SYS_MEASURE_CN_PARENTID] DEFAULT (0) FOR [CN_PARENTID]
GO

ALTER TABLE [dbo].[TN_SYS_MEASURE_FOLDER] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_MEASURE_FOLDER_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_MEASURE_FOLDER_CN_PARENTID] DEFAULT (0) FOR [CN_PARENTID],
	CONSTRAINT [PK_TN_SYS_MEASURE_FOLDER] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_MEDISTAS] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_MEDISTAS_CN_CARDID] DEFAULT (0) FOR [CN_CARDID],
	CONSTRAINT [DF_TN_SYS_MEDISTAS_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_MEDISTAS_CN_TABLENAME] DEFAULT (' ') FOR [CN_TABLENAME],
	CONSTRAINT [DF_TN_SYS_MEDISTAS_CN_MAINCARDCODE] DEFAULT (' ') FOR [CN_MAINCARDCODE],
	CONSTRAINT [DF_TN_SYS_MEDISTAS_CN_CURCARDCODE] DEFAULT (' ') FOR [CN_CURCARDCODE],
	CONSTRAINT [DF_TN_SYS_MEDISTAS_CN_HAVEMD] DEFAULT (0) FOR [CN_HAVEMD],
	CONSTRAINT [DF_TN_SYS_MEDISTAS_CN_MDNAME] DEFAULT (' ') FOR [CN_MDNAME]
GO

ALTER TABLE [dbo].[TN_SYS_MEDISTAS_R] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_MEDISTAS_R_CN_FIELDNAME] DEFAULT (' ') FOR [CN_FIELDNAME],
	CONSTRAINT [DF_TN_SYS_MEDISTAS_R_CN_CARDVARNAME] DEFAULT (' ') FOR [CN_CARDVARNAME],
	CONSTRAINT [DF_TN_SYS_MEDISTAS_R_CN_POSITION] DEFAULT (0) FOR [CN_VARSEAT],
	CONSTRAINT [DF_TN_SYS_MEDISTAS_R_CN_ISTOTAL] DEFAULT (0) FOR [CN_ISTOTAL],
	CONSTRAINT [DF_TN_SYS_MEDISTAS_R_CN_FIELDTYPE] DEFAULT (0) FOR [CN_FIELDTYPE],
	CONSTRAINT [DF_TN_SYS_MEDISTAS_R_CN_LENGTH] DEFAULT (0) FOR [CN_LENGTH],
	CONSTRAINT [DF_TN_SYS_MEDISTAS_R_CN_MEDIID] DEFAULT (0) FOR [CN_MEDIID]
GO

ALTER TABLE [dbo].[TN_SYS_MGR_CAPPCARD] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_MGR_CAPPCARD_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_MGR_CAPPCARD_CN_FILENAME] DEFAULT (' ') FOR [CN_FILENAME],
	CONSTRAINT [DF_TN_SYS_MGR_CAPPCARD_CN_BLOBID] DEFAULT (0) FOR [CN_BLOBID],
	CONSTRAINT [DF_TN_SYS_MGR_CAPPCARD_CN_PUTINDATE] DEFAULT (getdate()) FOR [CN_PUTINDATE],
	CONSTRAINT [DF_TN_SYS_MGR_CAPPCARD_CN_CARDID] DEFAULT (0) FOR [CN_CARDID],
	CONSTRAINT [DF_TN_SYS_MGR_CAPPCARD_CN_CARDOBJID] DEFAULT (0) FOR [CN_CARDOBJID],
	CONSTRAINT [PK_TN_SYS_MGR_CAPPCARD] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_MGRBLOB] WITH NOCHECK ADD 
	CONSTRAINT [PK_TN_SYS_MGRBLOB] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_OUTPUTFIELD] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_OUTPUTFIELD_CN_MAINCARDID] DEFAULT (0) FOR [CN_MAINCARDID],
	CONSTRAINT [DF_TN_SYS_OUTPUTFIELD_CN_CELLSEAT] DEFAULT (0) FOR [CN_CELLSEAT],
	CONSTRAINT [DF_TN_SYS_OUTPUTFIELD_CN_MDID] DEFAULT (0) FOR [CN_MDID],
	CONSTRAINT [DF_TN_SYS_OUTPUTFIELD_CN_FIELDNAME] DEFAULT (' ') FOR [CN_FIELDNAME],
	CONSTRAINT [DF_TN_SYS_OUTPUTFIELD_CN_SUM] DEFAULT (0) FOR [CN_SUM]
GO

ALTER TABLE [dbo].[TN_SYS_OUTVARREL] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_OUTVARREL_CN_OUTVAR] DEFAULT ('') FOR [CN_OUTVAR],
	CONSTRAINT [DF_TN_SYS_OUTVARREL_CN_CLASSNAME] DEFAULT ('') FOR [CN_CLASSNAME],
	CONSTRAINT [DF_TN_SYS_OUTVARREL_CN_FORMAT] DEFAULT ('') FOR [CN_FORMAT],
	CONSTRAINT [DF_TN_SYS_OUTVARREL_CN_ISUP] DEFAULT (0) FOR [CN_ISUP],
	CONSTRAINT [PK_TN_SYS_OUTVARREL] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_PAGEINFO] WITH NOCHECK ADD 
	CONSTRAINT [PK_TN_SYS_PAGEINFO] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_PROCESSVARREL] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_PROCESSVARREL_CN_OUTVAR] DEFAULT ('') FOR [CN_OUTVAR],
	CONSTRAINT [DF_TN_SYS_PROCESSVARREL_CN_CLASSNAME] DEFAULT ('') FOR [CN_CLASSNAME],
	CONSTRAINT [DF_TN_SYS_PROCESSVARREL_CN_FORMAT] DEFAULT ('') FOR [CN_FORMAT],
	CONSTRAINT [DF_TN_SYS_PROCESSVARREL_CN_ISUP] DEFAULT (0) FOR [CN_ISUP],
	CONSTRAINT [PK_TN_SYS_PROCESSVARREL] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_PURVIEW] WITH NOCHECK ADD 
	CONSTRAINT [PK_TN_SYS_PURVIEW] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID],
		[CN_PURVIEW]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_SC] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_SC_CN_US] DEFAULT (' ') FOR [CN_US],
	CONSTRAINT [DF_TN_SYS_SC_CN_LS] DEFAULT (' ') FOR [CN_LS],
	CONSTRAINT [DF_TN_SYS_SC_CN_TP] DEFAULT (' ') FOR [CN_TP],
	CONSTRAINT [DF_TN_SYS_SC_CN_RT] DEFAULT (' ') FOR [CN_RT]
GO

ALTER TABLE [dbo].[TN_SYS_SCRIPT] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_SCRIPT_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_SCRIPT_CN_ISFOLDER] DEFAULT (0) FOR [CN_ISFOLDER],
	CONSTRAINT [DF_TN_SYS_SCRIPT_CN_BLOBID] DEFAULT (0) FOR [CN_BLOBID],
	CONSTRAINT [DF_TN_SYS_SCRIPT_CN_PARENTID] DEFAULT (0) FOR [CN_PARENTID],
	CONSTRAINT [PK_TN_SYS_SCRIPT] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_SCRIPT_BLOB] WITH NOCHECK ADD 
	CONSTRAINT [PK_TN_SYS_SCRIPT_BLOB] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_STAT_OBJ] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_STAT_OBJ_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_STAT_OBJ_CN_PARENTID] DEFAULT (0) FOR [CN_PARENTID],
	CONSTRAINT [DF_TN_SYS_STAT_OBJ_CN_ISFOLDER] DEFAULT (0) FOR [CN_ISFOLDER],
	CONSTRAINT [DF_TN_SYS_STAT_OBJ_CN_BLOBID] DEFAULT (0) FOR [CN_BLOBID],
	CONSTRAINT [DF_TN_SYS_STAT_OBJ_CN_DESCRIPTION] DEFAULT (' ') FOR [CN_DESCRIPTION],
	CONSTRAINT [PK_TN_SYS_STAT_OBJ] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_STAT_PICKUP] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_STAT_PICKUP_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_STAT_PICKUP_CN_PARENTID] DEFAULT (0) FOR [CN_PARENTID],
	CONSTRAINT [DF_TN_SYS_STAT_PICKUP_CN_ISFOLDER] DEFAULT (0) FOR [CN_ISFOLDER],
	CONSTRAINT [DF_TN_SYS_STAT_PICKUP_CN_BLOBID] DEFAULT (0) FOR [CN_BLOBID],
	CONSTRAINT [DF_TN_SYS_STAT_PICKUP_CN_DESCRIPTION] DEFAULT (' ') FOR [CN_DESCRIPTION],
	CONSTRAINT [PK_TN_SYS_STAT_PICKUP] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_STAT_TEMPTB] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_STAT_TEMPTB_CN_TABNAME] DEFAULT (' ') FOR [CN_TABNAME],
	CONSTRAINT [DF_TN_SYS_STAT_TEMPTB_CN_DESCRIPTION] DEFAULT (' ') FOR [CN_DESCRIPTION],
	CONSTRAINT [PK_TN_SYS_STAT_TEMPTB] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_TABNAME]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_STAT_TEMPTBLOCKER] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_STAT_TEMPTBLOCKER_CN_TIME] DEFAULT (getdate()) FOR [CN_TIME]
GO

ALTER TABLE [dbo].[TN_SYS_SUBCARDINFO] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_SUBCARDINFO_CN_MID_ID] DEFAULT (0) FOR [CN_MID_ID],
	CONSTRAINT [DF_TN_SYS_SUBCARDINFO_CN_RECORD_ID] DEFAULT (0) FOR [CN_ROWOBJ_ID],
	CONSTRAINT [DF_TN_SYS_SUBCARDINFO_CN_SUBCARDID] DEFAULT (0) FOR [CN_SUBCARDID],
	CONSTRAINT [DF_TN_SYS_SUBCARDINFO_CN_SUBCARD_OBJID] DEFAULT (0) FOR [CN_SUBCARD_OBJID],
	CONSTRAINT [DF_TN_SYS_SUBCARDINFO_CN_SYS_HEADDATAID] DEFAULT (0) FOR [CN_HEADDATAID],
	CONSTRAINT [DF_TN_SYS_SUBCARDINFO_CN_SYS_INDEX] DEFAULT (0) FOR [CN_INDEX],
	CONSTRAINT [PK_TN_SYS_SUBCARDINFO] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_MID_ID],
		[CN_ROWOBJ_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_TASK_ATTACHMENT_BLOB] WITH NOCHECK ADD 
	CONSTRAINT [PK_TN_SYS_TASK_ATTACHMENT_BLOB] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_TASK_BLOB] WITH NOCHECK ADD 
	CONSTRAINT [PK_TN_SYS_TASK_BLOB] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_TASK_PRJ] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_TASK_PRJ_CN_ISFOLDERID] DEFAULT (0) FOR [CN_ISFOLDER],
	CONSTRAINT [DF_TN_SYS_TASK_PRJ_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_TASK_PRJ_CN_PARENTID] DEFAULT (0) FOR [CN_PARENTID],
	CONSTRAINT [DF_TN_SYS_TASK_PRJ_CN_BLOBID] DEFAULT (0) FOR [CN_BLOBID]
GO

ALTER TABLE [dbo].[TN_SYS_TEMPIDIDATA] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_TEMPIDIDATA_CN_IDIID] DEFAULT (0) FOR [CN_IDIID],
	CONSTRAINT [DF_TN_SYS_TEMPIDIDATA_CN_USERNAME] DEFAULT (' ') FOR [CN_USERNAME],
	CONSTRAINT [DF_TN_SYS_TEMPIDIDATA_CN_DATATIME] DEFAULT (getdate()) FOR [CN_DATETIME],
	CONSTRAINT [DF_TN_SYS_TEMPIDIDATA_CN_DATA] DEFAULT (' ') FOR [CN_DATA],
	CONSTRAINT [DF_TN_SYS_TEMPIDIDATA_CN_FOLDERID] DEFAULT (0) FOR [CN_FOLDERID],
	CONSTRAINT [PK_TN_SYS_TEMPIDIDATA] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_TEMPLATE_STRUDESCRIBE] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_TEMPLATE_STRUDESCRIBE_CN_TEMPLATENAME] DEFAULT ('') FOR [CN_TEMPLATENAME],
	CONSTRAINT [DF_TN_SYS_TEMPLATE_STRUDESCRIBE_CN_STRUINFO] DEFAULT ('') FOR [CN_STRUINFO],
	CONSTRAINT [DF_TN_SYS_TEMPLATE_STRUDESCRIBE_CN_ALLFUN] DEFAULT ('') FOR [CN_ALLFUN],
	CONSTRAINT [PK_TN_SYS_TEMPLATE_STRUDESCRIBE] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_TYPEAUDIT] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_TYPEAUDIT_CN_DESCRIBE1] DEFAULT (0) FOR [CN_PARENTID],
	CONSTRAINT [DF_TN_SYS_TYPEAUDIT_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_TYPEAUDIT_CN_DESCRIBE] DEFAULT (' ') FOR [CN_DESCRIBE],
	CONSTRAINT [DF_TN_SYS_TYPEAUDIT_CN_ISFOLDER] DEFAULT (0) FOR [CN_ISFOLDER],
	CONSTRAINT [DF_TN_SYS_TYPEAUDIT_CN_USERID] DEFAULT (0) FOR [CN_USERID],
	CONSTRAINT [DF_TN_SYS_TYPEAUDIT_CN_USED_NUM] DEFAULT (0) FOR [CN_USED_NUM],
	CONSTRAINT [PK_TN_SYS_TYPEAUDIT] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_TYPEAUDIT_STEP] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_TYPEAUDIT_STEP_CN_TYPEAUDIT_ID] DEFAULT (0) FOR [CN_TYPEAUDIT_ID],
	CONSTRAINT [DF_TN_SYS_TYPEAUDIT_STEP_CN_ORDER] DEFAULT (0) FOR [CN_ORDER],
	CONSTRAINT [DF_TN_SYS_TYPEAUDIT_STEP_CN_WORKNAME] DEFAULT (' ') FOR [CN_WORKNAME],
	CONSTRAINT [DF_TN_SYS_TYPEAUDIT_STEP_CN_WORKUSER] DEFAULT (' ') FOR [CN_WORKUSER]
GO

ALTER TABLE [dbo].[TN_SYS_TYPECARD] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_TYPECARD_CN_BLOBID] DEFAULT (0) FOR [CN_BLOBID],
	CONSTRAINT [DF_TN_SYS_TYPECARD_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_ALLTYPECARD_CN_ISFOLDER] DEFAULT (0) FOR [CN_ISFOLDER],
	CONSTRAINT [DF_TN_SYS_TYPECARD_产品名称] DEFAULT (' ') FOR [产品名称],
	CONSTRAINT [DF__TN_SYS_TYP__零件名称__0F4D3C5F] DEFAULT (' ') FOR [零件名称],
	CONSTRAINT [DF__TN_SYS_TYP__材料牌号__10416098] DEFAULT (' ') FOR [材料牌号],
	CONSTRAINT [DF__TN_SYS_TYP__零件图号__1E6562BD] DEFAULT (' ') FOR [零件图号]
GO

ALTER TABLE [dbo].[TN_SYS_TYPECARD_BLOB] WITH NOCHECK ADD 
	CONSTRAINT [PK_TN_SYS_TYPEBASE_BLOB] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_TYPECARD_FOLDER] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_TYPECARD_FOLDER_CN_NAME] DEFAULT ('') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_TYPECARD_FOLDER_CN_ISFOLDER] DEFAULT (0) FOR [CN_ISFOLDER],
	CONSTRAINT [DF_TN_SYS_TYPECARD_FOLDER_CN_PARENTID] DEFAULT (0) FOR [CN_PARENTID],
	CONSTRAINT [DF_TN_SYS_TYPECARD_FOLDER_CN_HAVESUB] DEFAULT (0) FOR [CN_HAVESUB],
	CONSTRAINT [PK_TN_SYS_TYPECARD_FOLDER] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_TYPECARD_OBJ] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_TYPECARD_OBJ_CN_NAME] DEFAULT ('') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_TYPECARD_OBJ_CN_PARENTID] DEFAULT (0) FOR [CN_PARENTID],
	CONSTRAINT [DF__TN_SYS_TYPEC__dd__708B2022] DEFAULT (0) FOR [KEY_FEATURE],
	CONSTRAINT [DF__TN_SYS_TY__showm__717F445B] DEFAULT (' ') FOR [KEY_OWNERNAME],
	CONSTRAINT [DF__TN_SYS_TY__carda__72736894] DEFAULT (' ') FOR [KEY_OWNERCODE],
	CONSTRAINT [DF_TN_SYS_TYPECARD_OBJ_CN_BLOB] DEFAULT (0) FOR [CN_BLOBID],
	CONSTRAINT [DF__TN_SYS_TY__hmmmm__424F5426] DEFAULT (0) FOR [hmmmmmmmmmm],
	CONSTRAINT [DF__TN_SYS_TYPE__t65__4343785F] DEFAULT (0) FOR [t65],
	CONSTRAINT [PK_TN_SYS_TYPECARD_OBJ] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_TYPECARD_PROPERTY] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_TYPECARD_PROPERTY_CN_CARDID] DEFAULT ('') FOR [CN_CARDID],
	CONSTRAINT [DF_TN_SYS_TYPECARD_PROPERTY_CN_CARDPROPERTY] DEFAULT ('') FOR [CN_CARDPROPERTY],
	CONSTRAINT [DF_TN_SYS_TYPECARD_PROPERTY_CN_PROPERTYVALUE] DEFAULT ('') FOR [CN_PROPERTYVALUE],
	CONSTRAINT [DF_TN_SYS_TYPECARD_PROPERTY_CN_FIELDTYPE] DEFAULT (1) FOR [CN_FIELDTYPE],
	CONSTRAINT [PK_TN_SYS_TYPECARD_PROPERTY] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_TYPECARDFOLDER] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_TYPECAREFOLDER_CN_FOLDERNAME] DEFAULT (' ') FOR [CN_FOLDERNAME],
	CONSTRAINT [DF_TN_SYS_TYPECAREFOLDER_CN_PARENTID] DEFAULT (0) FOR [CN_PARENTID],
	CONSTRAINT [PK_TN_SYS_TYPECAREFOLDER] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_TYPEFOLDER] WITH NOCHECK ADD 
	CONSTRAINT [PK_TN_SYS_TYPEFOLDER] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_TYPEROW] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_TYPEROW_CN_NAME] DEFAULT ('') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_TYPEROW_CN_DESCRIPTION] DEFAULT ('') FOR [CN_DESCRIPTION],
	CONSTRAINT [PK_TN_SYS_TYPEROW] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_TYPEROW_RULE] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_TYPEROW_RULE_CN_RULENAME] DEFAULT ('') FOR [CN_RULENAME],
	CONSTRAINT [DF_TN_SYS_TYPEROW_RULE_CN_BASENAME] DEFAULT ('') FOR [CN_BASENAME],
	CONSTRAINT [DF_TN_SYS_TYPEROW_RULE_CN_FIELDNAME] DEFAULT ('') FOR [CN_FIELDNAME],
	CONSTRAINT [DF_TN_SYS_TYPEROW_RULE_CN_CARDVAR] DEFAULT ('') FOR [CN_CARDVAR]
GO

ALTER TABLE [dbo].[TN_SYS_TYPEROWFOLDER] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_TYPEROWFOLDER_CN_PARENTID] DEFAULT (0) FOR [CN_PARENTID],
	CONSTRAINT [DF_TN_SYS_TYPEROWFOLDER_CN_NAME] DEFAULT (' ') FOR [CN_NAME],
	CONSTRAINT [DF_TN_SYS_TYPEROWFOLDER_CN_TABLENAME] DEFAULT (' ') FOR [CN_TABLENAME],
	CONSTRAINT [PK_TN_SYS_TYPEROWFOLDER] PRIMARY KEY  NONCLUSTERED 
	(
		[CN_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TN_SYS_USER_CAPPUNIT_R] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_USER_UNIT_R_CN_UNIT_ID] DEFAULT (0) FOR [CN_CAPPUNIT_ID],
	CONSTRAINT [DF_TN_SYS_USER_UNIT_R_CN_MEMID] DEFAULT (0) FOR [CN_USER_ID],
	CONSTRAINT [DF_TN_SYS_USER_UNIT_R_CN_ISLEAD] DEFAULT (0) FOR [CN_ISLEAD]
GO

ALTER TABLE [dbo].[TN_SYS_USERPOPEDEMINFO] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_USERPOPEDEMINFO_CN_USERNAME] DEFAULT ('') FOR [CN_USERNAME],
	CONSTRAINT [DF_TN_SYS_USERPOPEDEMINFO_CN_POPEDEMINFO] DEFAULT ('') FOR [CN_POPEDEMINFO],
	CONSTRAINT [DF_TN_SYS_USERPOPEDEMINFO_CN_ALLFUN] DEFAULT ('') FOR [CN_ALLFUN]
GO

ALTER TABLE [dbo].[TN_SYS_WORKSTEP] WITH NOCHECK ADD 
	CONSTRAINT [DF_TN_SYS_WORKSTEP_CN_NAME] DEFAULT (' ') FOR [CN_NAME]
GO

 CREATE  INDEX [IX_STRUINFO_TN_SYS_CAPPBOM] ON [dbo].[TN_SYS_CAPPBOM]([CN_STRUINFO]) ON [PRIMARY]
GO

