CREATE TABLE [QUERY_CONFIG_BRELATION](
	[ID] [varchar](8)  NOT NULL,
	[FID] [varchar](8)  NULL,
	[BID] [varchar](8)  NULL,
 CONSTRAINT [PK_QUERY_CONFIG_BRELATION] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)


CREATE TABLE [QUERY_CONFIG_BUTTON](
	[ID] [varchar](8)  NOT NULL,
	[NAME] [varchar](50)  NULL,
	[ICO] [varchar](50)  NULL,
	[PATHORJS] [varchar](300)  NULL,
	[RUNNAME] [varchar](50)  NULL,
        [ROLEIDS] [varchar](100)  NULL,
        [FID] [varchar](8)  NULL,
        [BCODE] [varchar](4)  NULL,
 CONSTRAINT [PK_QUERY_CONFIG_BUTTON] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)



CREATE TABLE [QUERY_CONFIG_CONNECTION](
	[ID] [varchar](8)  NOT NULL,
	[FID] [varchar](8)  NULL,
	[MFIELD] [varchar](50)  NULL,
	[CFIELD] [varchar](50)  NULL,
	[JOINTYPE] [varchar](1)  NULL,
 CONSTRAINT [PK_QUERY_CONFIG_CONNECTION] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)



CREATE TABLE [QUERY_CONFIG_INIT](
	[ID] [varchar](8)  NOT NULL,
	[FID] [varchar](8)  NULL,
	[QLEFT] [varchar](8)  NULL,
	[FIELD] [varchar](50)  NULL,
	[SYMBOL] [varchar](20)  NULL,
	[WHEREVALUE] [varchar](500)  NULL,
	[QRIGHT] [varchar](8)  NULL,
	[LOGIC] [char](1)  NULL,
 CONSTRAINT [PK_QUERY_CONFIG_INIT] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)



CREATE TABLE [QUERY_CONFIG_ORDER](
	[ID] [varchar](8)  NOT NULL,
	[FID] [varchar](8)  NULL,
	[FIELD] [varchar](50)  NULL,
	[TYPE] [char](1)  NULL,
 CONSTRAINT [PK_QUERY_CONFIG_ORDER] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)


CREATE TABLE [QUERY_CONFIG_PARAMETER](
	[ID] [varchar](8)  NOT NULL,
	[FID] [varchar](8)  NULL,
	[BID] [varchar](8)  NULL,
	[NAME] [varchar](50)  NULL,
	[FIELD] [varchar](50)  NULL,
 CONSTRAINT [PK_QUERY_CONFIG_PARAMETER] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)


CREATE TABLE [QUERY_CONFIG_QUERYFIELD](
	[ID] [varchar](8)  NOT NULL,
	[FID] [varchar](8)  NULL,
	[FIELD] [varchar](50)  NULL,
	[ISPRECISION] [varchar](1)  NULL,
	[ISMUST] [varchar](1)  NULL,
	[ISDAY] [varchar](3)  NULL,
	[DVALUE] [varchar](50)  NULL,
 CONSTRAINT [PK_QUERY_CONFIG_QUERYFIELD] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)


CREATE TABLE [QUERY_CONFIG_SHOWFIELD](
	[ID] [varchar](8)  NOT NULL,
	[FID] [varchar](8)  NULL,
	[FIELD] [varchar](50)  NULL,
	[ISSHOW] [char](1)  NULL,
	[COLWIDTH] [varchar](4)  NULL,
	[ISNUMBER] [varchar](1)  NULL,
        [QALIGN] [varchar](1)  NULL,
 CONSTRAINT [PK_QUERY_CONFIG_SHOWFIELD] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)


CREATE TABLE [QUERY_CONFIG_TABLE](
	[ID] [varchar](8)  NOT NULL,
	[NAME] [varchar](50)  NULL,
	[MAINTABLE] [varchar](50)  NULL,
	[TYPE] [char](1)  NULL,
	[BID] [varchar](8)  NULL,
	[IFFIRSTDATA] [varchar](1)  NULL,
	[IFMULSEL] [varchar](1)  NULL,
	[IFCOMBTN] [varchar](1)  NULL,
	[CID] [varchar](8)  NULL,
        [DCODE] [varchar](64)  NULL,
        [QITEMTYPE] [varchar](1)  NULL,
        [QTABLETYPE] [varchar](1)  NULL,
 CONSTRAINT [PK_QUERY_CONFIG_TABLE] PRIMARY KEY CLUSTERED 
(
	[ID]
)
)


CREATE TABLE [QUERY_TMP](
	[USERID] [varchar](16)  NOT NULL,
	[TMP] [varchar](500)  NULL
)

CREATE TABLE [QUERY_PARAMETER](
	[USERID] [varchar](16)  NULL,
	[QUERYID] [varchar](8)  NULL,
        [UP_HEIGHT] [varchar](4)  NULL,
	[DOWN_HEIGHT] [varchar](4)  NULL
)

