
CREATE TABLE [dbo].[customer](
	[cus_no] [varchar](50) NOT NULL,
	[name] [varchar](50) NOT NULL,
	[sam] [varchar](50) NULL
) ON [PRIMARY]

ALTER TABLE [dbo].[customer] WITH NOCHECK ADD 
	CONSTRAINT [PK_customer] PRIMARY KEY  CLUSTERED 
	(
	[cus_no] ASC
	)  ON [PRIMARY] 


CREATE TABLE [dbo].[user](
	[user_no] [varchar](4) NOT NULL,
	[name] [varchar](10) NULL,
	[user_pass] [varchar](8) NULL
) ON [PRIMARY]


CREATE TABLE [dbo].[de_pss](
	[ps_id] [varchar](20) NOT NULL,
	[data_code] [varchar](20) NOT NULL,
	[corporderid] [varchar](20) NOT NULL,
	[fromcorpid] [varchar](20) NULL,
	[tocorpid] [varchar](20) NULL,
	[ownercorpid] [varchar](10) NULL,
	[actor] [varchar](12) NULL,
	[actdate] [varchar](19) NULL,
	[wrongcode] [varchar](5) NULL,
	[uppercorporderid] [varchar](20) NULL,
	[sn] [varchar](30) NULL,
	[license] [varchar](10) NULL,
	[bat_no] [varchar](20) NULL,
	[make_dd] [varchar](6) NULL,
	[prd_no] [varchar](12) NULL,
	[isflag] [varchar](1) NULL,
	[jytype] [varchar](10) NULL
) ON [PRIMARY]

ALTER TABLE [dbo].[de_pss] WITH NOCHECK ADD 
	CONSTRAINT [PK_de_pss] PRIMARY KEY  CLUSTERED 
	(
	[ps_id] ASC,
	[data_code] ASC,
	[corporderid] ASC
	)  ON [PRIMARY] 


CREATE TABLE [dbo].[prdt](
	[data_code] [varchar](20) NOT NULL,
	[prd_no] [varchar](12) NOT NULL,
	[lar_no] [varchar](30) NULL,
	[factory] [varchar](60) NULL,
	[name] [varchar](60) NULL,
	[code_no] [varchar](60) NULL,
	[spc] [varchar](60) NULL,
	[packespc] [varchar](60) NULL,
	[check_no] [varchar](60) NULL,
	[sbname] [varchar](120) NULL,
	[sdc] [varchar](30) NULL,
	[packebl] [varchar](20) NULL,
	[packecj] [varchar](1) NULL,
        [prdtype] [varchar](10) NULL
) ON [PRIMARY]

ALTER TABLE [dbo].[prdt] WITH NOCHECK ADD 
	CONSTRAINT [PK_prdt] PRIMARY KEY  CLUSTERED 
	(
		[prd_no],
                [data_code]
	)  ON [PRIMARY] 


CREATE TABLE [dbo].[inorder](
        [ps_id] [varchar](20) NOT NULL,
	[cus_name] [varchar](80) NULL,
	[corporderid] [varchar](20) NULL,
	[prd_name] [varchar](40) NULL,
	[make_dd] [varchar](6) NULL,
	[bat_no] [varchar](20) NULL,
	[data_code] [varchar](20) NULL
) ON [PRIMARY]


CREATE TABLE [dbo].[GLIMIT](
	[GROUP_NO] [nvarchar](10) NOT NULL,
	[GROUP_NAME] [nvarchar](20) NULL,
	[G_LIMIT] [nvarchar](254) NULL,
	[C_USER] [nvarchar](5) NULL,
	[C_TIME] [nvarchar](14) NULL,
	[M_USER] [nvarchar](5) NULL,
	[M_TIME] [nvarchar](14) NULL,
	[UP_GROUP_NO] [nvarchar](10) NULL
) ON [PRIMARY]


CREATE TABLE [dbo].[SYSSET](
	[SP_METH] [nvarchar](1) NULL,
	[SP_LEN] [int] NULL,
	[ST_LEN] [int] NULL,
	[CUS_LEN] [int] NULL,
	[PRD_LEN] [int] NULL,
	[LAR_LEN] [int] NULL,
	[QTY_LEN] [int] NULL,
	[PRC_LEN] [int] NULL,
	[AMT_LEN] [int] NULL,
	[FOFI] [nvarchar](1) NULL,
	[TAX_RTO] [float] NULL,
	[SP_REUSE] [nvarchar](1) NULL,
	[ISWARN] [nvarchar](1) NULL,
	[ISCGBACK] [nvarchar](1) NULL,
	[ISXSBACK] [nvarchar](1) NULL,
	[POSPRC] [nvarchar](1) NULL,
	[XSPRC] [nvarchar](1) NULL,
	[PRC_CG] [int] NULL,
	[PRC_XS] [int] NULL,
	[BAT_NO] [nvarchar](1) NULL,
	[PCOLOR] [nvarchar](1) NULL,
	[PRINT_MTH] [nvarchar](1) NULL,
	[QTY_NO] [nvarchar](1) NULL,
	[SERIAL_NO] [nvarchar](1) NULL
) ON [PRIMARY]


CREATE TABLE [dbo].[ULIMIT](
	[USER_ID] [nvarchar](5) NULL,
	[USER_GROUP] [nvarchar](10) NULL,
	[USER_NAME] [nvarchar](10) NULL,
	[USER_PASS] [image] NULL,
	[LOCK_TIME] [int] NULL,
	[VALID_DAYS] [int] NULL,
	[EMP_NO] [nvarchar](5) NULL,
	[HIDEMENU] [nvarchar](1) NULL,
	[WARN_SET] [nvarchar](254) NULL,
	[C_TIME] [nvarchar](14) NULL,
	[C_USER] [nvarchar](5) NULL,
	[M_USER] [nvarchar](5) NULL,
	[M_TIME] [nvarchar](14) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]


CREATE TABLE [dbo].[pd](
	[data_code] [varchar](20) NOT NULL,
	[ownercorpid] [varchar](50) NOT NULL,
	[corporderid] [varchar](20) NOT NULL,
	[actor] [varchar](12) NULL,
	[actdate] [varchar](19) NULL,
	[jytype] [varchar](10) NULL,
	[isflag] [varchar](1) NULL
) ON [PRIMARY]


CREATE TABLE [dbo].[COMPANY](
	[COMP_NAME] [nvarchar](30) NULL,
	[COMP_ENG] [nvarchar](120) NULL,
	[COMP_USR] [nvarchar](6) NULL,
	[COMP_PASS] [image] NULL,
	[COMP_MAN] [nvarchar](10) NULL,
	[TEL] [nvarchar](20) NULL,
	[FAX] [nvarchar](20) NULL,
	[ADDRESS] [nvarchar](80) NULL,
	[ZIP_CODE] [nvarchar](7) NULL,
	[ACCOUNT] [nvarchar](20) NULL,
	[BANK] [nvarchar](30) NULL,
	[SHOP_ID] [nvarchar](100) NULL,
	[SHOP_TYPE] [nvarchar](1) NULL,
	[LIC_NO] [nvarchar](254) NULL,
	[HOMEPAGE] [nvarchar](254) NULL,
	[OPEN_YY] [nvarchar](12) NULL,
	[OPEN_MM] [nvarchar](12) NULL,
	[CLOSE_YY] [nvarchar](12) NULL,
	[CLOSE_MM] [nvarchar](12) NULL,
	[SN] [nvarchar](20) NULL,
	[LICESE_NO] [nvarchar](30) NULL,
	[INPATH] [varchar](254) NULL,
	[OUTPATH] [varchar](254) NOT NULL,
	[PUY] [varchar](254) NOT NULL,
	[TY] [varchar](254) NOT NULL,
	[TY1] [varchar](254) NOT NULL,
	[JYTYPE] [varchar](10) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]


CREATE TABLE [dbo].[USERS](
	[SHOP_ID] [varchar](19) NULL,
	[USER_ID] [varchar](4)  NOT NULL,
	[USER_NAME] [varchar](20)  NOT NULL,
	[PASSWORD] [varchar](250) NULL,
	[EMP_ID] [varchar](12) NULL,
	[EMP_NAME] [varchar](50) NULL,
	[VALID_DD] [int] NULL,
	[ISVALID] [varchar](1) NULL,
	[LOCK_TIME] [int] NULL
) ON [PRIMARY]

ALTER TABLE [dbo].[USERS] WITH NOCHECK ADD 
	CONSTRAINT [PK_USERS] PRIMARY KEY  CLUSTERED 
	(
	[USER_ID] ASC
	)  ON [PRIMARY] 


CREATE TABLE [dbo].[LIMITS](
	[USER_ID] [varchar](4) NULL,
	[M_NAME] [varchar](250) NULL,
	[M_NEW] [varchar](1) NULL,
	[M_MODI] [varchar](1) NULL,
	[M_DEL] [varchar](1) NULL,
	[M_SAVE] [varchar](1) NULL,
	[M_SEAR] [varchar](1) NULL,
	[M_PRINT] [varchar](1) NULL,
	[M_CHK] [varchar](1) NULL
) ON [PRIMARY]


CREATE TABLE [dbo].[JIA](
	[USER_ID] [varchar](200) NULL,
	[M_NAME] [varchar](250) NULL,
	[JQ] [varchar](200) NULL,
	[NC] [varchar](200) NULL
) ON [PRIMARY]

