/*
 Navicat Premium Dump SQL

 Source Server         : localhost
 Source Server Type    : SQL Server
 Source Server Version : 16004210 (16.00.4210)
 Source Host           : localhost:1433
 Source Catalog        : 17168erp_t
 Source Schema         : dbo

 Target Server Type    : SQL Server
 Target Server Version : 16004210 (16.00.4210)
 File Encoding         : 65001

 Date: 06/03/2026 19:08:58
*/


-- ----------------------------
-- Table structure for accounting
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[accounting]') AND type IN ('U'))
	DROP TABLE [dbo].[accounting]
GO

CREATE TABLE [dbo].[accounting] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [uptime] datetime DEFAULT CONVERT([varchar],getdate(),(111)) NULL,
  [category] int  NULL,
  [kind] int  NULL,
  [kind2] int  NULL,
  [price] real  NULL,
  [tax] real  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [mem_num] int  NULL,
  [debtor] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [activity_num] int  NULL,
  [excerpt] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [reg_time] datetime DEFAULT getdate() NULL,
  [pro_order_detail_num] int  NULL
)
GO

ALTER TABLE [dbo].[accounting] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'收支管理主檔',
'SCHEMA', N'dbo',
'TABLE', N'accounting'
GO


-- ----------------------------
-- Records of accounting
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[accounting] ON
GO

SET IDENTITY_INSERT [dbo].[accounting] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for accounting_files
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[accounting_files]') AND type IN ('U'))
	DROP TABLE [dbo].[accounting_files]
GO

CREATE TABLE [dbo].[accounting_files] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [accounting_num] int  NULL,
  [reg_time] datetime DEFAULT getdate() NULL,
  [pic1] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [pic1_name] nvarchar(150) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[accounting_files] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'收支附件檔',
'SCHEMA', N'dbo',
'TABLE', N'accounting_files'
GO


-- ----------------------------
-- Records of accounting_files
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[accounting_files] ON
GO

SET IDENTITY_INSERT [dbo].[accounting_files] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for accounting_kind
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[accounting_kind]') AND type IN ('U'))
	DROP TABLE [dbo].[accounting_kind]
GO

CREATE TABLE [dbo].[accounting_kind] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [kind] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [root] int DEFAULT 0 NULL,
  [range] int  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [title] nvarchar(30) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[accounting_kind] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'收支項目維護',
'SCHEMA', N'dbo',
'TABLE', N'accounting_kind'
GO


-- ----------------------------
-- Records of accounting_kind
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[accounting_kind] ON
GO

SET IDENTITY_INSERT [dbo].[accounting_kind] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for accounting_kind2
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[accounting_kind2]') AND type IN ('U'))
	DROP TABLE [dbo].[accounting_kind2]
GO

CREATE TABLE [dbo].[accounting_kind2] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [kind] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [root] int DEFAULT 0 NULL,
  [range] int  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [title] nvarchar(30) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [bank_name] nvarchar(30) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [bank_code] nvarchar(30) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [bank_id] nvarchar(30) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [record_payment] nvarchar(1) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[accounting_kind2] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'收支帳戶維護',
'SCHEMA', N'dbo',
'TABLE', N'accounting_kind2'
GO


-- ----------------------------
-- Records of accounting_kind2
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[accounting_kind2] ON
GO

SET IDENTITY_INSERT [dbo].[accounting_kind2] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for act_bom
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[act_bom]') AND type IN ('U'))
	DROP TABLE [dbo].[act_bom]
GO

CREATE TABLE [dbo].[act_bom] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [package_num] int  NULL,
  [item_num] int  NULL,
  [item_type] int  NULL,
  [group_name] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [optional] bit  NULL,
  [qty] int  NULL,
  [memo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[act_bom] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'組合品項(功德主)',
'SCHEMA', N'dbo',
'TABLE', N'act_bom'
GO


-- ----------------------------
-- Records of act_bom
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[act_bom] ON
GO

SET IDENTITY_INSERT [dbo].[act_bom] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for actItem
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[actItem]') AND type IN ('U'))
	DROP TABLE [dbo].[actItem]
GO

CREATE TABLE [dbo].[actItem] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [partno] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [subject] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [print_init] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [kind] int  NULL,
  [price] real  NULL,
  [status] nvarchar(1) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [extend] nvarchar(1) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [cycle] int  NULL,
  [category] int  NULL,
  [customize_data] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [reg_time] datetime DEFAULT getdate() NULL,
  [is_reconcile] nvarchar(1) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[actItem] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'品項管理主檔',
'SCHEMA', N'dbo',
'TABLE', N'actItem'
GO


-- ----------------------------
-- Records of actItem
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[actItem] ON
GO

INSERT INTO [dbo].[actItem] ([num], [partno], [subject], [print_init], [kind], [price], [status], [demo], [extend], [cycle], [category], [customize_data], [reg_time], [is_reconcile]) VALUES (N'1', N'', N'消災大牌位', N'', N'3', N'10000', N'Y', N'', N'N', NULL, N'1', N'', NULL, N'N')
GO

INSERT INTO [dbo].[actItem] ([num], [partno], [subject], [print_init], [kind], [price], [status], [demo], [extend], [cycle], [category], [customize_data], [reg_time], [is_reconcile]) VALUES (N'2', N'', N'消災中牌位', N'', N'3', N'5000', N'Y', N'', N'N', NULL, N'1', N'', NULL, N'N')
GO

INSERT INTO [dbo].[actItem] ([num], [partno], [subject], [print_init], [kind], [price], [status], [demo], [extend], [cycle], [category], [customize_data], [reg_time], [is_reconcile]) VALUES (N'3', N'', N'超薦大牌位', N'', N'4', N'10000', N'Y', N'', N'N', NULL, N'1', N'', NULL, N'N')
GO

INSERT INTO [dbo].[actItem] ([num], [partno], [subject], [print_init], [kind], [price], [status], [demo], [extend], [cycle], [category], [customize_data], [reg_time], [is_reconcile]) VALUES (N'4', N'', N'超薦中牌位', N'', N'4', N'5000', N'Y', N'', N'N', NULL, N'1', N'', NULL, N'N')
GO

SET IDENTITY_INSERT [dbo].[actItem] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for actItem_files
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[actItem_files]') AND type IN ('U'))
	DROP TABLE [dbo].[actItem_files]
GO

CREATE TABLE [dbo].[actItem_files] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [actItem_num] int  NOT NULL,
  [files_num] int  NOT NULL,
  [reg_time] datetime DEFAULT getdate() NULL
)
GO

ALTER TABLE [dbo].[actItem_files] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'品項相關文件檔',
'SCHEMA', N'dbo',
'TABLE', N'actItem_files'
GO


-- ----------------------------
-- Records of actItem_files
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[actItem_files] ON
GO

SET IDENTITY_INSERT [dbo].[actItem_files] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for actItem_kind
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[actItem_kind]') AND type IN ('U'))
	DROP TABLE [dbo].[actItem_kind]
GO

CREATE TABLE [dbo].[actItem_kind] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [kind] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [root] int DEFAULT 0 NULL,
  [range] int  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [status] nvarchar(1) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[actItem_kind] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'品項分類管理',
'SCHEMA', N'dbo',
'TABLE', N'actItem_kind'
GO


-- ----------------------------
-- Records of actItem_kind
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[actItem_kind] ON
GO

INSERT INTO [dbo].[actItem_kind] ([num], [kind], [root], [range], [demo], [status]) VALUES (N'1', N'法會', N'0', N'1', N'', N'Y')
GO

INSERT INTO [dbo].[actItem_kind] ([num], [kind], [root], [range], [demo], [status]) VALUES (N'2', N'牌位', N'1', N'1', N'', N'Y')
GO

INSERT INTO [dbo].[actItem_kind] ([num], [kind], [root], [range], [demo], [status]) VALUES (N'3', N'消災', N'2', N'1', N'', N'Y')
GO

INSERT INTO [dbo].[actItem_kind] ([num], [kind], [root], [range], [demo], [status]) VALUES (N'4', N'超薦', N'2', N'2', N'', N'Y')
GO

SET IDENTITY_INSERT [dbo].[actItem_kind] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for activity
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[activity]') AND type IN ('U'))
	DROP TABLE [dbo].[activity]
GO

CREATE TABLE [dbo].[activity] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [kind] int  NULL,
  [subject] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [print_init] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [address] nvarchar(200) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [startDate_solar] datetime  NULL,
  [endDate_solar] datetime  NULL,
  [hall] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [start_sexagenary] nvarchar(2) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [end_sexagenary] nvarchar(2) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [monk] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [startDate_lunar] datetime  NULL,
  [endDate_lunar] datetime  NULL,
  [dueDate] datetime  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [reg_time] datetime DEFAULT getdate() NULL,
  [customize_data] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [category_kind] int  NULL
)
GO

ALTER TABLE [dbo].[activity] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'活動主檔',
'SCHEMA', N'dbo',
'TABLE', N'activity'
GO


-- ----------------------------
-- Records of activity
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[activity] ON
GO

SET IDENTITY_INSERT [dbo].[activity] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for activity_category_kind
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[activity_category_kind]') AND type IN ('U'))
	DROP TABLE [dbo].[activity_category_kind]
GO

CREATE TABLE [dbo].[activity_category_kind] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [kind] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [root] int DEFAULT 0 NULL,
  [range] int  NULL
)
GO

ALTER TABLE [dbo].[activity_category_kind] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'活動主類型',
'SCHEMA', N'dbo',
'TABLE', N'activity_category_kind'
GO


-- ----------------------------
-- Records of activity_category_kind
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[activity_category_kind] ON
GO

SET IDENTITY_INSERT [dbo].[activity_category_kind] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for activity_check
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[activity_check]') AND type IN ('U'))
	DROP TABLE [dbo].[activity_check]
GO

CREATE TABLE [dbo].[activity_check] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [f_num] int  NULL,
  [activity_num] int  NULL,
  [reg_time] datetime DEFAULT getdate() NULL,
  [status] int  NULL,
  [qty] int  NULL
)
GO

ALTER TABLE [dbo].[activity_check] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'活動報到檔',
'SCHEMA', N'dbo',
'TABLE', N'activity_check'
GO


-- ----------------------------
-- Records of activity_check
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[activity_check] ON
GO

SET IDENTITY_INSERT [dbo].[activity_check] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for activity_kind
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[activity_kind]') AND type IN ('U'))
	DROP TABLE [dbo].[activity_kind]
GO

CREATE TABLE [dbo].[activity_kind] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [kind] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [root] int DEFAULT 0 NULL,
  [range] int  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [calendar] nvarchar(2) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [month] int  NULL,
  [day] int  NULL
)
GO

ALTER TABLE [dbo].[activity_kind] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'活動詳細分類',
'SCHEMA', N'dbo',
'TABLE', N'activity_kind'
GO


-- ----------------------------
-- Records of activity_kind
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[activity_kind] ON
GO

INSERT INTO [dbo].[activity_kind] ([num], [kind], [root], [range], [demo], [calendar], [month], [day]) VALUES (N'1', N'水陸', N'0', N'1', N'', N'國曆', N'3', N'3')
GO

SET IDENTITY_INSERT [dbo].[activity_kind] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for activity_kind_detail
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[activity_kind_detail]') AND type IN ('U'))
	DROP TABLE [dbo].[activity_kind_detail]
GO

CREATE TABLE [dbo].[activity_kind_detail] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [activity_kind_num] int  NOT NULL,
  [actItem_num] int  NOT NULL,
  [price] real  NULL,
  [qty] int  NULL,
  [reg_time] datetime DEFAULT getdate() NULL
)
GO

ALTER TABLE [dbo].[activity_kind_detail] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'活動分類-相關品項',
'SCHEMA', N'dbo',
'TABLE', N'activity_kind_detail'
GO


-- ----------------------------
-- Records of activity_kind_detail
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[activity_kind_detail] ON
GO

INSERT INTO [dbo].[activity_kind_detail] ([num], [activity_kind_num], [actItem_num], [price], [qty], [reg_time]) VALUES (N'1', N'1', N'1', N'10000', N'1', N'2026-02-04 10:18:22.950')
GO

INSERT INTO [dbo].[activity_kind_detail] ([num], [activity_kind_num], [actItem_num], [price], [qty], [reg_time]) VALUES (N'2', N'1', N'3', N'10000', N'1', N'2026-02-04 10:18:30.990')
GO

SET IDENTITY_INSERT [dbo].[activity_kind_detail] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for activity_relating
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[activity_relating]') AND type IN ('U'))
	DROP TABLE [dbo].[activity_relating]
GO

CREATE TABLE [dbo].[activity_relating] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [activity_num] int  NOT NULL,
  [actItem_num] int  NOT NULL,
  [price] real  NULL,
  [qty] int  NULL,
  [reg_time] datetime DEFAULT getdate() NULL
)
GO

ALTER TABLE [dbo].[activity_relating] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'活動主檔-相關品項',
'SCHEMA', N'dbo',
'TABLE', N'activity_relating'
GO


-- ----------------------------
-- Records of activity_relating
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[activity_relating] ON
GO

SET IDENTITY_INSERT [dbo].[activity_relating] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for activity_spares
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[activity_spares]') AND type IN ('U'))
	DROP TABLE [dbo].[activity_spares]
GO

CREATE TABLE [dbo].[activity_spares] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [activity_num] int  NOT NULL,
  [actItem_num] int  NOT NULL,
  [qty1] int  NULL,
  [qty2] int  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [reg_time] datetime DEFAULT getdate() NULL
)
GO

ALTER TABLE [dbo].[activity_spares] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'活動主檔-相關備品',
'SCHEMA', N'dbo',
'TABLE', N'activity_spares'
GO


-- ----------------------------
-- Records of activity_spares
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[activity_spares] ON
GO

SET IDENTITY_INSERT [dbo].[activity_spares] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for admin
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[admin]') AND type IN ('U'))
	DROP TABLE [dbo].[admin]
GO

CREATE TABLE [dbo].[admin] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [u_id] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [u_password] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [u_name] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [sex] nvarchar(2) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [kind] nvarchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [phone1] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [phone2] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [birthday] datetime  NULL,
  [email] nvarchar(200) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [city] nvarchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [area] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [address] nvarchar(255) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [uid] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [power] nvarchar(3) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [online] bit  NOT NULL,
  [reg_time] datetime DEFAULT getdate() NULL,
  [login_time] datetime  NULL,
  [login_ip] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [login_code] nvarchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [adwidth] nvarchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [wrp_news] nvarchar(1) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT N'Y' NULL,
  [wrp_bar] nvarchar(1) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT N'Y' NULL,
  [gauth_key] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [gauth_enabled] bit  NULL
)
GO

ALTER TABLE [dbo].[admin] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'使用者管理',
'SCHEMA', N'dbo',
'TABLE', N'admin'
GO


-- ----------------------------
-- Records of admin
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[admin] ON
GO

INSERT INTO [dbo].[admin] ([num], [u_id], [u_password], [u_name], [sex], [kind], [phone1], [phone2], [birthday], [email], [city], [area], [address], [uid], [demo], [power], [online], [reg_time], [login_time], [login_ip], [login_code], [adwidth], [wrp_news], [wrp_bar], [gauth_key], [gauth_enabled]) VALUES (N'1', N'17168ERP', N'JKUkMX4iye481EA+1Of7ew=', N'總管理者', N'男', N'管理者', N'', N'', NULL, N'', NULL, NULL, NULL, NULL, N'', N'EZ', N'1', N'2022-02-08 17:37:57.513', N'2026-03-06 11:15:14.000', N'127.0.0.1', N'axjgwvya74', NULL, N'Y', N'Y', NULL, NULL)
GO

INSERT INTO [dbo].[admin] ([num], [u_id], [u_password], [u_name], [sex], [kind], [phone1], [phone2], [birthday], [email], [city], [area], [address], [uid], [demo], [power], [online], [reg_time], [login_time], [login_ip], [login_code], [adwidth], [wrp_news], [wrp_bar], [gauth_key], [gauth_enabled]) VALUES (N'2', N'user1', N'l63HaBs5T2GJyc1hiixsOA=', N'用戶1', N'男', N'管理者', N'', N'', NULL, N'', NULL, NULL, NULL, NULL, N'', N'A01', N'0', N'2022-05-05 17:48:14.857', N'2022-05-12 17:44:14.000', N'127.0.0.1', N'wgibb91ipm', NULL, N'Y', N'Y', N'dQqeG0G2wHANWyoDzTIw', N'1')
GO

INSERT INTO [dbo].[admin] ([num], [u_id], [u_password], [u_name], [sex], [kind], [phone1], [phone2], [birthday], [email], [city], [area], [address], [uid], [demo], [power], [online], [reg_time], [login_time], [login_ip], [login_code], [adwidth], [wrp_news], [wrp_bar], [gauth_key], [gauth_enabled]) VALUES (N'3', N'user2', N'I+M86B0qX3bc18kKtksJMw=', N'用戶2', N'男', N'管理者', N'', N'', NULL, N'', NULL, NULL, NULL, NULL, N'', N'A01', N'1', N'2022-05-05 17:48:34.823', N'2022-05-09 21:40:04.000', N'127.0.0.1', N'fbyw2bc9px', NULL, N'Y', N'Y', N'4KHwXR+h0cSxOBJ0640b', N'1')
GO

INSERT INTO [dbo].[admin] ([num], [u_id], [u_password], [u_name], [sex], [kind], [phone1], [phone2], [birthday], [email], [city], [area], [address], [uid], [demo], [power], [online], [reg_time], [login_time], [login_ip], [login_code], [adwidth], [wrp_news], [wrp_bar], [gauth_key], [gauth_enabled]) VALUES (N'4', N'user3', N'6dA9kWMrIMT1bMJYhkEifA=', N'用戶3', N'男', N'管理者', N'', N'', NULL, N'', NULL, NULL, NULL, NULL, N'', N'A01', N'1', N'2022-05-05 17:48:53.377', N'2022-05-12 17:46:09.000', N'127.0.0.1', N'yhdiucgcrr', NULL, N'Y', N'Y', N'ZbsFecpskB4wt3Xbq09K', N'1')
GO

INSERT INTO [dbo].[admin] ([num], [u_id], [u_password], [u_name], [sex], [kind], [phone1], [phone2], [birthday], [email], [city], [area], [address], [uid], [demo], [power], [online], [reg_time], [login_time], [login_ip], [login_code], [adwidth], [wrp_news], [wrp_bar], [gauth_key], [gauth_enabled]) VALUES (N'5', N'ezLottie', N'FOS6JxNITls0uj+JqdMdH8=', N'Lottie', N'男', N'管理者', N'', N'', NULL, N'', NULL, NULL, NULL, NULL, N'', N'A01', N'1', N'2022-05-17 10:30:53.983', N'2023-01-02 02:38:59.000', N'220.135.64.176', N'dx13gs9sn5', NULL, N'Y', N'Y', N'5Ie9QZlPBqmB2fGrp5Ye', N'0')
GO

INSERT INTO [dbo].[admin] ([num], [u_id], [u_password], [u_name], [sex], [kind], [phone1], [phone2], [birthday], [email], [city], [area], [address], [uid], [demo], [power], [online], [reg_time], [login_time], [login_ip], [login_code], [adwidth], [wrp_news], [wrp_bar], [gauth_key], [gauth_enabled]) VALUES (N'6', N'tracy', N'ElXxGeQvlhX63vjzj3VT+o=', N'tracy', N'男', N'管理者', N'', N'', NULL, N'', NULL, NULL, NULL, NULL, N'', N'A01', N'0', N'2022-10-14 15:51:52.920', N'2022-12-19 14:45:32.000', N'211.20.239.58', N'qegivd9sna', NULL, N'Y', N'Y', NULL, NULL)
GO

INSERT INTO [dbo].[admin] ([num], [u_id], [u_password], [u_name], [sex], [kind], [phone1], [phone2], [birthday], [email], [city], [area], [address], [uid], [demo], [power], [online], [reg_time], [login_time], [login_ip], [login_code], [adwidth], [wrp_news], [wrp_bar], [gauth_key], [gauth_enabled]) VALUES (N'8', N'111', N'1JjrHuvUBcEZo64KsIp92M=', N'A君', N'男', N'管理者', N'', N'', NULL, N'', NULL, NULL, NULL, NULL, N'', N'A02', N'1', N'2022-12-06 15:39:58.980', N'2023-03-20 15:06:26.000', N'122.117.61.232', N'bjchvtvtea', NULL, N'Y', N'Y', NULL, N'0')
GO

INSERT INTO [dbo].[admin] ([num], [u_id], [u_password], [u_name], [sex], [kind], [phone1], [phone2], [birthday], [email], [city], [area], [address], [uid], [demo], [power], [online], [reg_time], [login_time], [login_ip], [login_code], [adwidth], [wrp_news], [wrp_bar], [gauth_key], [gauth_enabled]) VALUES (N'9', N'chinchillann', N'HrGQmtD0aL7Eu6W173wItY=', N'舒安', N'男', N'管理者', N'', N'', NULL, N'', NULL, NULL, NULL, NULL, N'', N'A03', N'0', N'2023-03-20 14:35:39.200', N'2023-05-17 08:58:17.000', N'122.117.61.232', N'wk2c2hssrn', NULL, N'Y', N'Y', N'Bktm9FPtBbWosRd9QPaE', N'0')
GO

INSERT INTO [dbo].[admin] ([num], [u_id], [u_password], [u_name], [sex], [kind], [phone1], [phone2], [birthday], [email], [city], [area], [address], [uid], [demo], [power], [online], [reg_time], [login_time], [login_ip], [login_code], [adwidth], [wrp_news], [wrp_bar], [gauth_key], [gauth_enabled]) VALUES (N'10', N'123', N'8gdk0wvYYkOGOnsowM8mWk=', N'路人乙', N'男', N'管理者', N'', N'', NULL, N'', NULL, NULL, NULL, NULL, N'', N'A01', N'0', N'2023-03-20 15:10:13.417', N'2023-03-22 15:22:08.000', N'122.117.61.232', N'nkreaje92s', NULL, N'Y', N'Y', NULL, NULL)
GO

INSERT INTO [dbo].[admin] ([num], [u_id], [u_password], [u_name], [sex], [kind], [phone1], [phone2], [birthday], [email], [city], [area], [address], [uid], [demo], [power], [online], [reg_time], [login_time], [login_ip], [login_code], [adwidth], [wrp_news], [wrp_bar], [gauth_key], [gauth_enabled]) VALUES (N'11', N'chimei', N'BrBEV+cDOSHgsJU58scIT0=', N'琪美姊姊', N'男', N'管理者', N'', N'', NULL, N'', NULL, NULL, NULL, NULL, N'', N'A03', N'0', N'2023-03-24 20:15:59.927', N'2023-04-07 16:21:30.000', N'49.217.9.241', N'nyf47i9vt2', NULL, N'Y', N'Y', NULL, N'0')
GO

INSERT INTO [dbo].[admin] ([num], [u_id], [u_password], [u_name], [sex], [kind], [phone1], [phone2], [birthday], [email], [city], [area], [address], [uid], [demo], [power], [online], [reg_time], [login_time], [login_ip], [login_code], [adwidth], [wrp_news], [wrp_bar], [gauth_key], [gauth_enabled]) VALUES (N'12', N'test', N'A2TEg0SoqKfZbvvIHg9Gdo=', N'志工', N'男', N'管理者', N'', N'', NULL, N'', NULL, NULL, NULL, NULL, N'', N'A04', N'1', N'2023-04-21 14:57:05.243', N'2023-04-22 13:50:04.000', N'49.217.45.88', N'bysr1dpm2e', NULL, N'Y', N'Y', NULL, NULL)
GO

INSERT INTO [dbo].[admin] ([num], [u_id], [u_password], [u_name], [sex], [kind], [phone1], [phone2], [birthday], [email], [city], [area], [address], [uid], [demo], [power], [online], [reg_time], [login_time], [login_ip], [login_code], [adwidth], [wrp_news], [wrp_bar], [gauth_key], [gauth_enabled]) VALUES (N'13', N'susan', N'J8bB+e977atsd+XodDPRY0=', N'淑惠', N'男', N'管理者', N'', N'', NULL, N'', NULL, NULL, NULL, NULL, N'', N'A03', N'1', N'2023-04-25 15:18:22.883', N'2023-08-17 17:06:17.000', N'59.120.82.208', N'n91pisnde4', NULL, N'Y', N'Y', NULL, NULL)
GO

INSERT INTO [dbo].[admin] ([num], [u_id], [u_password], [u_name], [sex], [kind], [phone1], [phone2], [birthday], [email], [city], [area], [address], [uid], [demo], [power], [online], [reg_time], [login_time], [login_ip], [login_code], [adwidth], [wrp_news], [wrp_bar], [gauth_key], [gauth_enabled]) VALUES (N'17', N'sw01', N'9kRkS5sdrBDxyyz4rJJ+2c=', N'練習', N'男', N'管理者', N'', N'', NULL, N'', NULL, NULL, NULL, NULL, N'', N'A03', N'1', N'2024-09-05 10:49:37.590', N'2025-02-21 08:27:29.000', N'36.235.29.56', N'vwegbpxyuu', NULL, N'Y', N'Y', NULL, N'0')
GO

INSERT INTO [dbo].[admin] ([num], [u_id], [u_password], [u_name], [sex], [kind], [phone1], [phone2], [birthday], [email], [city], [area], [address], [uid], [demo], [power], [online], [reg_time], [login_time], [login_ip], [login_code], [adwidth], [wrp_news], [wrp_bar], [gauth_key], [gauth_enabled]) VALUES (N'18', N'test1', N'19DZBdfvfjz+JWC8Sgaqw8=', N'huangkj', N'男', N'管理者', N'', N'', NULL, N'', NULL, NULL, NULL, NULL, N'', N'A03', N'1', N'2024-09-05 16:42:53.830', N'2025-09-08 14:51:54.000', N'210.61.157.19', N'va43sjas4h', NULL, N'Y', N'Y', NULL, N'0')
GO

INSERT INTO [dbo].[admin] ([num], [u_id], [u_password], [u_name], [sex], [kind], [phone1], [phone2], [birthday], [email], [city], [area], [address], [uid], [demo], [power], [online], [reg_time], [login_time], [login_ip], [login_code], [adwidth], [wrp_news], [wrp_bar], [gauth_key], [gauth_enabled]) VALUES (N'19', N'hkj123456', N'k+6BhDcDbLcDnkMqGbpWMpwpzRaQiA1id==', N'黄开杰', N'男', N'管理者', N'', N'', NULL, N'', NULL, NULL, NULL, NULL, N'', N'A03', N'1', N'2024-12-12 13:06:33.460', N'2025-11-07 10:36:41.000', N'210.61.157.19', N'qe63hhtwfg', NULL, N'Y', N'Y', NULL, NULL)
GO

SET IDENTITY_INSERT [dbo].[admin] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for admin_group
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[admin_group]') AND type IN ('U'))
	DROP TABLE [dbo].[admin_group]
GO

CREATE TABLE [dbo].[admin_group] (
  [g_name] nvarchar(3) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [items] nvarchar(255) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [demo] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[admin_group] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'群組資料',
'SCHEMA', N'dbo',
'TABLE', N'admin_group'
GO


-- ----------------------------
-- Records of admin_group
-- ----------------------------
BEGIN TRANSACTION
GO

INSERT INTO [dbo].[admin_group] ([g_name], [items], [demo]) VALUES (N'A', N'28,54,29,36,37,51,52,31,58,34,35,63,38,39,57,64,83,84,40,41,62,42,55,56,4,7,10,46,47,49,50,1,2,3,9,8,11,12,23,53,24,25,26,27,20,22,21,30,43,44,45,48,59,61,60,65,74,66,67,68,69,70,73,71,72,87,', N'最大管理者')
GO

INSERT INTO [dbo].[admin_group] ([g_name], [items], [demo]) VALUES (N'A01', N'4,7,10,1,2,3,9,8,11,12,', N'人事')
GO

INSERT INTO [dbo].[admin_group] ([g_name], [items], [demo]) VALUES (N'A02', N'28,38,40,55,29,54,39,41,42,56,', N'志工')
GO

INSERT INTO [dbo].[admin_group] ([g_name], [items], [demo]) VALUES (N'A03', N'28,54,29,36,37,51,52,31,58,34,35,63,38,39,57,64,83,84,40,41,62,42,85,86,55,56,79,82,81,78,75,77,76,4,5,7,10,46,47,49,50,1,2,3,9,8,11,12,23,53,24,25,26,27,20,22,21,30,43,44,45,48,59,61,60,65,74,66,67,68,80,69,70,73,71,72,87,', N'總管理員')
GO

INSERT INTO [dbo].[admin_group] ([g_name], [items], [demo]) VALUES (N'A04', N'43,44,45,48,', N'練習用')
GO

INSERT INTO [dbo].[admin_group] ([g_name], [items], [demo]) VALUES (N'B01', N'1,2,3,9,8,11,12,23,53,24,25,26,27,36,51,52,37,28,29,54,31,58,34,35,38,39,57,', N'功能群組-牌位')
GO

INSERT INTO [dbo].[admin_group] ([g_name], [items], [demo]) VALUES (N'EZ', N'28,54,29,36,37,51,52,31,58,34,35,63,38,39,57,64,83,84,40,41,62,42,55,56,75,4,5,7,10,46,47,49,50,1,2,3,9,8,11,12,23,53,24,25,26,27,20,22,21,30,43,44,45,48,59,61,60,65,74,66,67,68,69,70,71,72,87,', N'系統管理者')
GO

INSERT INTO [dbo].[admin_group] ([g_name], [items], [demo]) VALUES (N'tg', N'7,1,2,3,9,8,11,12,23,53,24,25,26,27,20,22,21,30,28,29,54,31,34,35,38,39,43,44,45,48,36,51,52,37,40,41,42,55,56,46,47,49,50,', N'testgroup')
GO

COMMIT
GO


-- ----------------------------
-- Table structure for admin_log
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[admin_log]') AND type IN ('U'))
	DROP TABLE [dbo].[admin_log]
GO

CREATE TABLE [dbo].[admin_log] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [u_id] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [login_time] datetime DEFAULT getdate() NULL,
  [login_ip] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [status] int  NULL,
  [agent] nvarchar(5) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [word] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [systems] int  NULL
)
GO

ALTER TABLE [dbo].[admin_log] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'登入記錄查詢',
'SCHEMA', N'dbo',
'TABLE', N'admin_log'
GO


-- ----------------------------
-- Records of admin_log
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[admin_log] ON
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'1', N'17168ERP', N'2026-01-23 10:27:42.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'2', N'17168ERP', N'2026-01-28 08:20:37.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'1002', N'17168ERP', N'2026-02-03 17:21:19.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'1003', N'17168ERP', N'2026-02-03 17:21:58.957', N'127.0.0.1', N'2', N'電腦', N'詳細分類：水陸', N'3')
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'2002', N'user01', N'2026-02-04 09:38:06.000', N'127.0.0.1', N'1', N'電腦', N'帳號或密碼錯誤', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'2003', N'17168ERP', N'2026-02-04 09:38:28.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'2004', N'17168ERP', N'2026-02-04 10:14:38.110', N'127.0.0.1', N'3', N'電腦', N'分類：法會', N'6')
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'2005', N'17168ERP', N'2026-02-04 10:14:56.263', N'127.0.0.1', N'3', N'電腦', N'分類：牌位', N'6')
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'2006', N'17168ERP', N'2026-02-04 10:15:08.193', N'127.0.0.1', N'3', N'電腦', N'分類：消災', N'6')
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'2007', N'17168ERP', N'2026-02-04 10:15:21.060', N'127.0.0.1', N'3', N'電腦', N'分類：超薦', N'6')
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'2008', N'17168ERP', N'2026-02-04 10:16:04.517', N'127.0.0.1', N'2', N'電腦', N'消災大牌位', N'6')
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'2009', N'17168ERP', N'2026-02-04 10:16:39.703', N'127.0.0.1', N'2', N'電腦', N'消災中牌位', N'6')
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'2010', N'17168ERP', N'2026-02-04 10:17:00.200', N'127.0.0.1', N'2', N'電腦', N'超薦大牌位', N'6')
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'2011', N'17168ERP', N'2026-02-04 10:17:27.777', N'127.0.0.1', N'2', N'電腦', N'超薦中牌位', N'6')
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'2012', N'17168ERP', N'2026-02-04 11:03:23.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'2013', N'user01', N'2026-02-23 11:31:13.000', N'127.0.0.1', N'1', N'電腦', N'帳號或密碼錯誤', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'2014', N'user01', N'2026-02-23 11:34:31.000', N'127.0.0.1', N'1', N'電腦', N'帳號或密碼錯誤', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'2015', N'17168erp', N'2026-02-23 11:35:50.000', N'127.0.0.1', N'1', N'電腦', N'帳號或密碼錯誤', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'2016', N'17168ERP', N'2026-02-23 11:36:02.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3013', N'17168ERP', N'2026-03-02 08:29:35.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3014', N'17168ERP', N'2026-03-02 08:48:18.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3015', N'17168ERP', N'2026-03-02 13:32:05.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3016', N'17168ERP', N'2026-03-02 13:33:43.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3017', N'17168ERP', N'2026-03-02 13:35:19.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3018', N'17168ERP', N'2026-03-02 13:37:04.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3019', N'17168ERP', N'2026-03-02 13:39:14.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3020', N'17168ERP', N'2026-03-02 13:43:10.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3021', N'17168ERP', N'2026-03-02 13:44:51.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3022', N'17168ERP', N'2026-03-02 13:46:59.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3023', N'17168ERP', N'2026-03-02 14:07:23.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3024', N'17168ERP', N'2026-03-02 14:08:25.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3025', N'17168ERP', N'2026-03-02 14:09:44.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3026', N'17168ERP', N'2026-03-02 14:10:58.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3027', N'17168ERP', N'2026-03-02 14:13:51.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3028', N'17168ERP', N'2026-03-02 14:17:19.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3029', N'17168ERP', N'2026-03-02 14:18:30.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3030', N'17168ERP', N'2026-03-02 14:20:24.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3031', N'17168ERP', N'2026-03-02 14:22:07.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3032', N'17168ERP', N'2026-03-02 15:59:04.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3033', N'17168ERP', N'2026-03-02 17:22:03.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3034', N'17168ERP', N'2026-03-02 17:23:19.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3035', N'17168ERP', N'2026-03-02 17:28:15.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3036', N'17168ERP', N'2026-03-02 17:29:19.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3037', N'17168ERP', N'2026-03-02 17:30:59.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3038', N'17168ERP', N'2026-03-02 17:31:51.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3039', N'17168ERP', N'2026-03-02 17:32:59.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3040', N'17168ERP', N'2026-03-02 17:34:38.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3041', N'17168ERP', N'2026-03-02 17:36:52.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'3042', N'17168ERP', N'2026-03-02 17:38:44.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4013', N'17168ERP', N'2026-03-03 07:54:01.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4014', N'17168ERP', N'2026-03-03 07:56:12.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4015', N'17168ERP', N'2026-03-03 07:57:13.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4016', N'17168ERP', N'2026-03-03 08:08:23.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4017', N'17168ERP', N'2026-03-03 08:10:00.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4018', N'17168ERP', N'2026-03-03 08:11:29.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4019', N'17168ERP', N'2026-03-03 08:26:08.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4020', N'17168ERP', N'2026-03-03 08:28:10.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4021', N'17168ERP', N'2026-03-03 08:30:27.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4022', N'17168ERP', N'2026-03-03 09:13:16.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4023', N'17168ERP', N'2026-03-03 09:19:27.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4024', N'17168ERP', N'2026-03-03 09:20:15.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4025', N'17168ERP', N'2026-03-03 09:23:35.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4026', N'17168ERP', N'2026-03-03 09:28:23.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4027', N'17168ERP', N'2026-03-03 11:11:11.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4028', N'17168ERP', N'2026-03-03 11:14:28.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4029', N'17168ERP', N'2026-03-03 11:20:01.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4030', N'17168ERP', N'2026-03-03 11:25:39.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4031', N'17168ERP', N'2026-03-03 11:29:23.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4032', N'17168ERP', N'2026-03-03 11:33:13.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4033', N'17168ERP', N'2026-03-03 11:52:03.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4034', N'17168ERP', N'2026-03-03 11:53:34.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4035', N'17168ERP', N'2026-03-03 11:57:46.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4036', N'17168ERP', N'2026-03-03 15:33:50.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4037', N'17168ERP', N'2026-03-03 15:40:21.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'4038', N'17168ERP', N'2026-03-03 16:02:52.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'5013', N'17168ERP', N'2026-03-04 10:55:12.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'5014', N'17168ERP', N'2026-03-04 11:12:08.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'5015', N'17168ERP', N'2026-03-04 11:21:45.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'5016', N'17168ERP', N'2026-03-04 13:42:37.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'6013', N'17168ERP', N'2026-03-05 08:10:20.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'6014', N'17168ERP', N'2026-03-05 08:24:01.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'6015', N'17168ERP', N'2026-03-05 10:41:38.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'6016', N'17168ERP', N'2026-03-05 11:28:45.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'6017', N'17168ERP', N'2026-03-05 13:29:37.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'6018', N'17168ERP', N'2026-03-05 14:54:21.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'6019', N'17168ERP', N'2026-03-05 14:58:55.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'6020', N'17168ERP', N'2026-03-05 15:16:42.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'6021', N'17168ERP', N'2026-03-05 16:49:44.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'6022', N'17168ERP', N'2026-03-05 16:58:26.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'6023', N'17168ERP', N'2026-03-05 17:02:45.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'6024', N'17168ERP', N'2026-03-05 17:29:44.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'6025', N'17168ERP', N'2026-03-05 17:43:38.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'7013', N'17168ERP', N'2026-03-06 07:42:05.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

INSERT INTO [dbo].[admin_log] ([num], [u_id], [login_time], [login_ip], [status], [agent], [word], [systems]) VALUES (N'7014', N'17168ERP', N'2026-03-06 11:15:14.000', N'127.0.0.1', N'1', N'電腦', N'登入成功', NULL)
GO

SET IDENTITY_INSERT [dbo].[admin_log] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for AncestralTabletArea
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[AncestralTabletArea]') AND type IN ('U'))
	DROP TABLE [dbo].[AncestralTabletArea]
GO

CREATE TABLE [dbo].[AncestralTabletArea] (
  [AreaId] int  IDENTITY(1,1) NOT NULL,
  [AreaName] nvarchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [AreaCode] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [ParentAreaId] int  NULL,
  [AreaType] nvarchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [Price] int  NULL,
  [SortOrder] int  NULL,
  [IsDisabled] bit DEFAULT 0 NOT NULL,
  [Description] nvarchar(200) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[AncestralTabletArea] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of AncestralTabletArea
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[AncestralTabletArea] ON
GO

SET IDENTITY_INSERT [dbo].[AncestralTabletArea] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for AncestralTabletPosition
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[AncestralTabletPosition]') AND type IN ('U'))
	DROP TABLE [dbo].[AncestralTabletPosition]
GO

CREATE TABLE [dbo].[AncestralTabletPosition] (
  [PositionId] int  IDENTITY(1,1) NOT NULL,
  [AreaId] int  NOT NULL,
  [PositionCode] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [PositionName] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [Price] int  NULL,
  [StatusCode] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [Description] nvarchar(200) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [RowNo] int  NULL,
  [ColumnNo] int  NULL
)
GO

ALTER TABLE [dbo].[AncestralTabletPosition] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of AncestralTabletPosition
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[AncestralTabletPosition] ON
GO

SET IDENTITY_INSERT [dbo].[AncestralTabletPosition] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for AncestralTabletPositionRecord
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[AncestralTabletPositionRecord]') AND type IN ('U'))
	DROP TABLE [dbo].[AncestralTabletPositionRecord]
GO

CREATE TABLE [dbo].[AncestralTabletPositionRecord] (
  [RecordId] int  IDENTITY(1,1) NOT NULL,
  [RegistrantCode] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [NPTitle] nvarchar(30) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [NPStandDate] date  NOT NULL,
  [NPYangShang] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [WPContent] nvarchar(1000) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [CreatedAt] datetime DEFAULT getdate() NOT NULL,
  [UpdatedAt] datetime  NULL
)
GO

ALTER TABLE [dbo].[AncestralTabletPositionRecord] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of AncestralTabletPositionRecord
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[AncestralTabletPositionRecord] ON
GO

SET IDENTITY_INSERT [dbo].[AncestralTabletPositionRecord] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for AncestralTabletRegistrant
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[AncestralTabletRegistrant]') AND type IN ('U'))
	DROP TABLE [dbo].[AncestralTabletRegistrant]
GO

CREATE TABLE [dbo].[AncestralTabletRegistrant] (
  [RegistrantCode] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [Name] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [Phone] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [Address] nvarchar(60) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [RegisterDate] date  NOT NULL,
  [Price] int  NULL,
  [PositionId] int  NULL,
  [StartDate] date  NOT NULL,
  [EndDate] date  NULL,
  [IsLongTerm] bit DEFAULT 0 NOT NULL,
  [IsActive] bit DEFAULT 1 NOT NULL,
  [CreatedAt] datetime DEFAULT getdate() NOT NULL,
  [UpdatedAt] datetime  NULL,
  [IsEnd] bit DEFAULT 0 NOT NULL
)
GO

ALTER TABLE [dbo].[AncestralTabletRegistrant] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of AncestralTabletRegistrant
-- ----------------------------
BEGIN TRANSACTION
GO

COMMIT
GO


-- ----------------------------
-- Table structure for AncestralTabletStatus
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[AncestralTabletStatus]') AND type IN ('U'))
	DROP TABLE [dbo].[AncestralTabletStatus]
GO

CREATE TABLE [dbo].[AncestralTabletStatus] (
  [StatusCode] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [StatusName] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [StatusType] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL
)
GO

ALTER TABLE [dbo].[AncestralTabletStatus] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of AncestralTabletStatus
-- ----------------------------
BEGIN TRANSACTION
GO

INSERT INTO [dbo].[AncestralTabletStatus] ([StatusCode], [StatusName], [StatusType]) VALUES (N'available', N'可用', N'Position')
GO

INSERT INTO [dbo].[AncestralTabletStatus] ([StatusCode], [StatusName], [StatusType]) VALUES (N'maintenance', N'維護中', N'Position')
GO

INSERT INTO [dbo].[AncestralTabletStatus] ([StatusCode], [StatusName], [StatusType]) VALUES (N'used', N'已使用', N'Position')
GO

COMMIT
GO


-- ----------------------------
-- Table structure for appellation
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[appellation]') AND type IN ('U'))
	DROP TABLE [dbo].[appellation]
GO

CREATE TABLE [dbo].[appellation] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [title] nvarchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[appellation] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'(新)',
'SCHEMA', N'dbo',
'TABLE', N'appellation'
GO


-- ----------------------------
-- Records of appellation
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[appellation] ON
GO

SET IDENTITY_INSERT [dbo].[appellation] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for bed_kind
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[bed_kind]') AND type IN ('U'))
	DROP TABLE [dbo].[bed_kind]
GO

CREATE TABLE [dbo].[bed_kind] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [kind] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [root] int DEFAULT 0 NULL,
  [range] int  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [sex] nvarchar(2) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[bed_kind] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'房間管理主檔',
'SCHEMA', N'dbo',
'TABLE', N'bed_kind'
GO


-- ----------------------------
-- Records of bed_kind
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[bed_kind] ON
GO

SET IDENTITY_INSERT [dbo].[bed_kind] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for bed_kind_detail
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[bed_kind_detail]') AND type IN ('U'))
	DROP TABLE [dbo].[bed_kind_detail]
GO

CREATE TABLE [dbo].[bed_kind_detail] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [bed_kind_id] int  NULL,
  [bed_name] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [bed_type] int  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[bed_kind_detail] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'房間管理-床位明細',
'SCHEMA', N'dbo',
'TABLE', N'bed_kind_detail'
GO


-- ----------------------------
-- Records of bed_kind_detail
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[bed_kind_detail] ON
GO

SET IDENTITY_INSERT [dbo].[bed_kind_detail] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for bed_order
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[bed_order]') AND type IN ('U'))
	DROP TABLE [dbo].[bed_order]
GO

CREATE TABLE [dbo].[bed_order] (
  [bed_order_no] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [order_no] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [o_detail_id] int  NULL,
  [start_date] datetime  NULL,
  [end_date] datetime  NULL,
  [phone] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [keyin1] nvarchar(2) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [reg_time] datetime DEFAULT getdate() NULL
)
GO

ALTER TABLE [dbo].[bed_order] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'報名-掛單主檔',
'SCHEMA', N'dbo',
'TABLE', N'bed_order'
GO


-- ----------------------------
-- Records of bed_order
-- ----------------------------
BEGIN TRANSACTION
GO

COMMIT
GO


-- ----------------------------
-- Table structure for bed_order_detail
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[bed_order_detail]') AND type IN ('U'))
	DROP TABLE [dbo].[bed_order_detail]
GO

CREATE TABLE [dbo].[bed_order_detail] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [bed_order_no] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [checkIn_date] datetime  NULL,
  [bed_kind1] int  NULL,
  [bed_kind2] int  NULL,
  [bed_kind_detail_id] int  NULL,
  [license] nvarchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[bed_order_detail] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'報名-掛單明細',
'SCHEMA', N'dbo',
'TABLE', N'bed_order_detail'
GO


-- ----------------------------
-- Records of bed_order_detail
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[bed_order_detail] ON
GO

SET IDENTITY_INSERT [dbo].[bed_order_detail] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for company
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[company]') AND type IN ('U'))
	DROP TABLE [dbo].[company]
GO

CREATE TABLE [dbo].[company] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [com_name] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [com_mail] nvarchar(200) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [bcc_mail] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [pic_url] nvarchar(200) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [menu] bit  NULL,
  [log_class] bit  NULL,
  [log_menu] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [last_order_no] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [adwidth] nvarchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [wrp_news] nvarchar(1) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT N'Y' NULL,
  [wrp_bar] nvarchar(1) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT N'Y' NULL,
  [smtp_url] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [smtp_port] nvarchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [smtp_ssl] nvarchar(1) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [smtp_user] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [smtp_password] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [smtp_def] nvarchar(1) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [use_sender] nvarchar(1) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [bed_order_no] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[company] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'後台設定檔',
'SCHEMA', N'dbo',
'TABLE', N'company'
GO


-- ----------------------------
-- Records of company
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[company] ON
GO

INSERT INTO [dbo].[company] ([num], [com_name], [com_mail], [bcc_mail], [pic_url], [menu], [log_class], [log_menu], [last_order_no], [adwidth], [wrp_news], [wrp_bar], [smtp_url], [smtp_port], [smtp_ssl], [smtp_user], [smtp_password], [smtp_def], [use_sender], [bed_order_no]) VALUES (N'1', N'道場管理', N'jsc.main001@gmail.com', N'', N'https://demo2.eztrust.tw/17168ERP', N'0', N'1', N'', N'AA2511230001', N'1000px', N'Y', N'Y', N'msa.hinet.net', N'25', N'N', N'17168erp', N'Zfo0mDh1+hKem67XYviQQA=', N'', N'N', N'ED2305120001')
GO

SET IDENTITY_INSERT [dbo].[company] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for country
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[country]') AND type IN ('U'))
	DROP TABLE [dbo].[country]
GO

CREATE TABLE [dbo].[country] (
  [ID] nvarchar(5) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [ID2] nvarchar(5) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [ID3] nvarchar(5) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [range] int  NULL,
  [name_en] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [name_zh] nvarchar(30) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[country] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'國家列表',
'SCHEMA', N'dbo',
'TABLE', N'country'
GO


-- ----------------------------
-- Records of country
-- ----------------------------
BEGIN TRANSACTION
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'10', N'AQ', N'ATA', N'99', N'Antarctica', N'南極洲')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'100', N'BG', N'BGR', N'99', N'Bulgaria', N'保加利亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'104', N'MM', N'MMR', N'99', N'Myanmar', N'緬甸')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'108', N'BI', N'BDI', N'99', N'Burundi', N'蒲隆地')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'112', N'BY', N'BLR', N'99', N'Belarus', N'白俄羅斯')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'116', N'KH', N'KHM', N'99', N'Cambodia', N'柬埔寨')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'12', N'DZ', N'DZA', N'99', N'Algeria', N'阿爾及利亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'120', N'CM', N'CMR', N'99', N'Cameroon', N'喀麥隆')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'124', N'CA', N'CAN', N'3', N'Canada', N'加拿大')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'132', N'CV', N'CPV', N'99', N'Cabo Verde', N'維德角')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'136', N'KY', N'CYM', N'99', N'Cayman Islands', N'開曼群島')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'140', N'CF', N'CAF', N'99', N'Central African Republic', N'中非')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'144', N'LK', N'LKA', N'99', N'Sri Lanka', N'斯里蘭卡')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'148', N'TD', N'TCD', N'99', N'Chad', N'查德')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'152', N'CL', N'CHL', N'99', N'Chile', N'智利')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'156', N'CN', N'CHN', N'2', N'China', N'中國')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'158', N'TW', N'TWN', N'1', N'Republic of China(Taiwan)', N'中華民國(台灣)')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'16', N'AS', N'ASM', N'99', N'American Samoa', N'美屬薩摩亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'162', N'CX', N'CXR', N'99', N'Christmas Island', N'聖誕島')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'166', N'CC', N'CCK', N'99', N'Cocos (Keeling) Islands', N'科科斯（基林）群島')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'170', N'CO', N'COL', N'99', N'Colombia', N'哥倫比亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'174', N'KM', N'COM', N'99', N'Comoros', N'葛摩')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'175', N'YT', N'MYT', N'99', N'Mayotte', N'馬約特')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'178', N'CG', N'COG', N'99', N'Congo', N'剛果共和國')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'180', N'CD', N'COD', N'99', N'Congo (Democratic Republic of the)', N'剛果民主共和國')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'184', N'CK', N'COK', N'99', N'Cook Islands', N'庫克群島')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'188', N'CR', N'CRI', N'99', N'Costa Rica', N'哥斯大黎加')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'191', N'HR', N'HRV', N'99', N'Croatia', N'克羅埃西亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'192', N'CU', N'CUB', N'99', N'Cuba', N'古巴')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'196', N'CY', N'CYP', N'99', N'Cyprus', N'賽普勒斯')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'20', N'AD', N'AND', N'99', N'Andorra', N'安道爾')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'203', N'CZ', N'CZE', N'99', N'Czechia', N'捷克')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'204', N'BJ', N'BEN', N'99', N'Benin', N'貝南')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'208', N'DK', N'DNK', N'99', N'Denmark', N'丹麥')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'212', N'DM', N'DMA', N'99', N'Dominica', N'多米尼克')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'214', N'DO', N'DOM', N'99', N'Dominican Republic', N'多明尼加')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'218', N'EC', N'ECU', N'99', N'Ecuador', N'厄瓜多')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'222', N'SV', N'SLV', N'99', N'El Salvador', N'薩爾瓦多')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'226', N'GQ', N'GNQ', N'99', N'Equatorial Guinea', N'赤道幾內亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'231', N'ET', N'ETH', N'99', N'Ethiopia', N'衣索比亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'232', N'ER', N'ERI', N'99', N'Eritrea', N'厄利垂亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'233', N'EE', N'EST', N'99', N'Estonia', N'愛沙尼亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'234', N'FO', N'FRO', N'99', N'Faroe Islands', N'法羅群島')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'238', N'FK', N'FLK', N'99', N'Falkland Islands (Malvinas)', N'福克蘭群島')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'239', N'GS', N'SGS', N'99', N'South Georgia and the South Sandwich Islands', N'南喬治亞和南桑威奇群島')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'24', N'AO', N'AGO', N'99', N'Angola', N'安哥拉')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'242', N'FJ', N'FJI', N'99', N'Fiji', N'斐濟')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'246', N'FI', N'FIN', N'99', N'Finland', N'芬蘭')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'248', N'AX', N'ALA', N'99', N'Åland Islands', N'奧蘭')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'250', N'FR', N'FRA', N'99', N'France', N'法國')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'254', N'GF', N'GUF', N'99', N'French Guiana', N'法屬圭亞那')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'258', N'PF', N'PYF', N'99', N'French Polynesia', N'法屬玻里尼西亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'260', N'TF', N'ATF', N'99', N'French Southern Territories', N'法屬南部和南極領地')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'262', N'DJ', N'DJI', N'99', N'Djibouti', N'吉布地')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'266', N'GA', N'GAB', N'99', N'Gabon', N'加彭')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'268', N'GE', N'GEO', N'99', N'Georgia', N'喬治亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'270', N'GM', N'GMB', N'99', N'Gambia', N'甘比亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'275', N'PS', N'PSE', N'99', N'Palestine, State of', N'巴勒斯坦')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'276', N'DE', N'DEU', N'99', N'Germany', N'德國')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'28', N'AG', N'ATG', N'99', N'Antigua and Barbuda', N'安地卡及巴布達')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'288', N'GH', N'GHA', N'99', N'Ghana', N'迦納')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'292', N'GI', N'GIB', N'99', N'Gibraltar', N'直布羅陀')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'296', N'KI', N'KIR', N'99', N'Kiribati', N'吉里巴斯')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'300', N'GR', N'GRC', N'99', N'Greece', N'希臘')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'304', N'GL', N'GRL', N'99', N'Greenland', N'格陵蘭')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'308', N'GD', N'GRD', N'99', N'Grenada', N'格瑞那達')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'31', N'AZ', N'AZE', N'99', N'Azerbaijan', N'亞塞拜然')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'312', N'GP', N'GLP', N'99', N'Guadeloupe', N'瓜地洛普')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'316', N'GU', N'GUM', N'99', N'Guam', N'關島')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'32', N'AR', N'ARG', N'99', N'Argentina', N'阿根廷')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'320', N'GT', N'GTM', N'99', N'Guatemala', N'瓜地馬拉')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'324', N'GN', N'GIN', N'99', N'Guinea', N'幾內亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'328', N'GY', N'GUY', N'99', N'Guyana', N'蓋亞那')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'332', N'HT', N'HTI', N'99', N'Haiti', N'海地')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'334', N'HM', N'HMD', N'99', N'Heard Island and McDonald Islands', N'赫德島和麥克唐納群島')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'336', N'VA', N'VAT', N'99', N'Holy See', N'梵蒂岡')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'340', N'HN', N'HND', N'99', N'Honduras', N'宏都拉斯')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'344', N'HK', N'HKG', N'2', N'Hong Kong', N'香港')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'348', N'HU', N'HUN', N'99', N'Hungary', N'匈牙利')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'352', N'IS', N'ISL', N'99', N'Iceland', N'冰島')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'356', N'IN', N'IND', N'99', N'India', N'印度')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'36', N'AU', N'AUS', N'3', N'Australia', N'澳洲')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'360', N'ID', N'IDN', N'2', N'Indonesia', N'印度尼西亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'364', N'IR', N'IRN', N'99', N'Iran (Islamic Republic of)', N'伊朗')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'368', N'IQ', N'IRQ', N'99', N'Iraq', N'伊拉克')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'372', N'IE', N'IRL', N'99', N'Ireland', N'愛爾蘭')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'376', N'IL', N'ISR', N'99', N'Israel', N'以色列')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'380', N'IT', N'ITA', N'99', N'Italy', N'義大利')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'384', N'CI', N'CIV', N'99', N'Côte d''Ivoire', N'象牙海岸')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'388', N'JM', N'JAM', N'99', N'Jamaica', N'牙買加')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'392', N'JP', N'JPN', N'99', N'Japan', N'日本')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'398', N'KZ', N'KAZ', N'99', N'Kazakhstan', N'哈薩克')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'4', N'AF', N'AFG', N'99', N'Afghanistan', N'阿富汗')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'40', N'AT', N'AUT', N'99', N'Austria', N'奧地利')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'400', N'JO', N'JOR', N'99', N'Jordan', N'約旦')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'404', N'KE', N'KEN', N'99', N'Kenya', N'肯亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'408', N'KP', N'PRK', N'99', N'Korea (Democratic People''s Republic of)', N'北韓')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'410', N'KR', N'KOR', N'99', N'Korea (Republic of)', N'南韓')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'414', N'KW', N'KWT', N'99', N'Kuwait', N'科威特')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'417', N'KG', N'KGZ', N'99', N'Kyrgyzstan', N'吉爾吉斯')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'418', N'LA', N'LAO', N'99', N'Lao People''s Democratic Republic', N'寮國')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'422', N'LB', N'LBN', N'99', N'Lebanon', N'黎巴嫩')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'426', N'LS', N'LSO', N'99', N'Lesotho', N'賴索托')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'428', N'LV', N'LVA', N'99', N'Latvia', N'拉脫維亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'430', N'LR', N'LBR', N'99', N'Liberia', N'賴比瑞亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'434', N'LY', N'LBY', N'99', N'Libya', N'利比亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'438', N'LI', N'LIE', N'99', N'Liechtenstein', N'列支敦斯登')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'44', N'BS', N'BHS', N'99', N'Bahamas', N'巴哈馬')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'440', N'LT', N'LTU', N'99', N'Lithuania', N'立陶宛')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'442', N'LU', N'LUX', N'99', N'Luxembourg', N'盧森堡')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'446', N'MO', N'MAC', N'99', N'Macao', N'澳門')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'450', N'MG', N'MDG', N'99', N'Madagascar', N'馬達加斯加')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'454', N'MW', N'MWI', N'99', N'Malawi', N'馬拉威')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'458', N'MY', N'MYS', N'2', N'Malaysia', N'馬來西亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'462', N'MV', N'MDV', N'99', N'Maldives', N'馬爾地夫')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'466', N'ML', N'MLI', N'99', N'Mali', N'馬利')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'470', N'MT', N'MLT', N'99', N'Malta', N'馬爾他')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'474', N'MQ', N'MTQ', N'99', N'Martinique', N'馬丁尼克')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'478', N'MR', N'MRT', N'99', N'Mauritania', N'茅利塔尼亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'48', N'BH', N'BHR', N'99', N'Bahrain', N'巴林')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'480', N'MU', N'MUS', N'99', N'Mauritius', N'模里西斯')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'484', N'MX', N'MEX', N'99', N'Mexico', N'墨西哥')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'492', N'MC', N'MCO', N'99', N'Monaco', N'摩納哥')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'496', N'MN', N'MNG', N'99', N'Mongolia', N'蒙古')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'498', N'MD', N'MDA', N'99', N'Moldova (Republic of)', N'摩爾多瓦')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'499', N'ME', N'MNE', N'99', N'Montenegro', N'蒙特內哥羅')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'50', N'BD', N'BGD', N'99', N'Bangladesh', N'孟加拉')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'500', N'MS', N'MSR', N'99', N'Montserrat', N'蒙特塞拉特')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'504', N'MA', N'MAR', N'99', N'Morocco', N'摩洛哥')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'508', N'MZ', N'MOZ', N'99', N'Mozambique', N'莫三比克')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'51', N'AM', N'ARM', N'99', N'Armenia', N'亞美尼亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'512', N'OM', N'OMN', N'99', N'Oman', N'阿曼')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'516', N'NA', N'NAM', N'99', N'Namibia', N'納米比亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'52', N'BB', N'BRB', N'99', N'Barbados', N'巴貝多')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'520', N'NR', N'NRU', N'99', N'Nauru', N'諾魯')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'524', N'NP', N'NPL', N'99', N'Nepal', N'尼泊爾')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'528', N'NL', N'NLD', N'99', N'Netherlands', N'荷蘭')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'531', N'CW', N'CUW', N'99', N'Curacao !Curaçao', N'古拉索')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'533', N'AW', N'ABW', N'99', N'Aruba', N'阿魯巴')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'534', N'SX', N'SXM', N'99', N'Sint Maarten (Dutch part)', N'荷屬聖馬丁')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'535', N'BQ', N'BES', N'99', N'Bonaire, Sint Eustatius and Saba', N'荷蘭加勒比區')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'540', N'NC', N'NCL', N'99', N'New Caledonia', N'新喀里多尼亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'548', N'VU', N'VUT', N'99', N'Vanuatu', N'萬那杜')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'554', N'NZ', N'NZL', N'3', N'New Zealand', N'紐西蘭')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'558', N'NI', N'NIC', N'99', N'Nicaragua', N'尼加拉瓜')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'56', N'BE', N'BEL', N'99', N'Belgium', N'比利時')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'562', N'NE', N'NER', N'99', N'Niger', N'尼日')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'566', N'NG', N'NGA', N'99', N'Nigeria', N'奈及利亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'570', N'NU', N'NIU', N'99', N'Niue', N'紐埃')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'574', N'NF', N'NFK', N'99', N'Norfolk Island', N'諾福克島')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'578', N'NO', N'NOR', N'99', N'Norway', N'挪威')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'580', N'MP', N'MNP', N'99', N'Northern Mariana Islands', N'北馬利安納群島')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'581', N'UM', N'UMI', N'99', N'United States Minor Outlying Islands', N'美國本土外小島嶼')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'583', N'FM', N'FSM', N'99', N'Micronesia (Federated States of)', N'密克羅尼西亞聯邦')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'584', N'MH', N'MHL', N'99', N'Marshall Islands', N'馬紹爾群島')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'585', N'PW', N'PLW', N'99', N'Palau', N'帛琉')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'586', N'PK', N'PAK', N'99', N'Pakistan', N'巴基斯坦')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'591', N'PA', N'PAN', N'99', N'Panama', N'巴拿馬')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'598', N'PG', N'PNG', N'99', N'Papua New Guinea', N'巴布亞紐幾內亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'60', N'BM', N'BMU', N'99', N'Bermuda', N'百慕達')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'600', N'PY', N'PRY', N'99', N'Paraguay', N'巴拉圭')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'604', N'PE', N'PER', N'99', N'Peru', N'秘魯')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'608', N'PH', N'PHL', N'99', N'Philippines', N'菲律賓')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'612', N'PN', N'PCN', N'99', N'Pitcairn', N'皮特凱恩群島')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'616', N'PL', N'POL', N'99', N'Poland', N'波蘭')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'620', N'PT', N'PRT', N'99', N'Portugal', N'葡萄牙')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'624', N'GW', N'GNB', N'99', N'Guinea-Bissau', N'幾內亞比索')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'626', N'TL', N'TLS', N'99', N'Timor-Leste', N'東帝汶')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'630', N'PR', N'PRI', N'99', N'Puerto Rico', N'波多黎各')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'634', N'QA', N'QAT', N'99', N'Qatar', N'卡達')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'638', N'RE', N'REU', N'99', N'Réunion', N'留尼旺')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'64', N'BT', N'BTN', N'99', N'Bhutan', N'不丹')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'642', N'RO', N'ROU', N'99', N'Romania', N'羅馬尼亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'643', N'RU', N'RUS', N'99', N'Russian Federation', N'俄羅斯')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'646', N'RW', N'RWA', N'99', N'Rwanda', N'盧安達')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'652', N'BL', N'BLM', N'99', N'Saint Barthélemy', N'聖巴瑟米')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'654', N'SH', N'SHN', N'99', N'Saint Helena, Ascension and Tristan da Cunha', N'聖赫倫那、阿森松和特里斯坦-達庫尼亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'659', N'KN', N'KNA', N'99', N'Saint Kitts and Nevis', N'聖克里斯多福及尼維斯')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'660', N'AI', N'AIA', N'99', N'Anguilla', N'安圭拉')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'662', N'LC', N'LCA', N'99', N'Saint Lucia', N'聖露西亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'663', N'MF', N'MAF', N'99', N'Saint Martin (French part)', N'法屬聖馬丁')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'666', N'PM', N'SPM', N'99', N'Saint Pierre and Miquelon', N'聖皮埃與密克隆群島')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'670', N'VC', N'VCT', N'99', N'Saint Vincent and the Grenadines', N'聖文森及格瑞那丁')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'674', N'SM', N'SMR', N'99', N'San Marino', N'聖馬利諾')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'678', N'ST', N'STP', N'99', N'Sao Tome and Principe', N'聖多美普林西比')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'68', N'BO', N'BOL', N'99', N'Bolivia (Plurinational State of)', N'玻利維亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'682', N'SA', N'SAU', N'99', N'Saudi Arabia', N'沙烏地阿拉伯')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'686', N'SN', N'SEN', N'99', N'Senegal', N'塞內加爾')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'688', N'RS', N'SRB', N'99', N'Serbia', N'塞爾維亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'690', N'SC', N'SYC', N'99', N'Seychelles', N'塞席爾')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'694', N'SL', N'SLE', N'99', N'Sierra Leone', N'獅子山')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'70', N'BA', N'BIH', N'99', N'Bosnia and Herzegovina', N'波士尼亞與赫塞哥維納')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'702', N'SG', N'SGP', N'2', N'Singapore', N'新加坡')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'703', N'SK', N'SVK', N'99', N'Slovakia', N'斯洛伐克')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'704', N'VN', N'VNM', N'99', N'Viet Nam', N'越南')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'705', N'SI', N'SVN', N'99', N'Slovenia', N'斯洛維尼亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'706', N'SO', N'SOM', N'99', N'Somalia', N'索馬利亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'710', N'ZA', N'ZAF', N'99', N'South Africa', N'南非')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'716', N'ZW', N'ZWE', N'99', N'Zimbabwe', N'辛巴威')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'72', N'BW', N'BWA', N'99', N'Botswana', N'波札那')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'724', N'ES', N'ESP', N'99', N'Spain', N'西班牙')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'728', N'SS', N'SSD', N'99', N'South Sudan', N'南蘇丹')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'729', N'SD', N'SDN', N'99', N'Sudan', N'蘇丹')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'732', N'EH', N'ESH', N'99', N'Western Sahara', N'西撒哈拉')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'74', N'BV', N'BVT', N'99', N'Bouvet Island', N'布韋島')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'740', N'SR', N'SUR', N'99', N'Suriname', N'蘇利南')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'744', N'SJ', N'SJM', N'99', N'Svalbard and Jan Mayen', N'斯瓦爾巴和揚馬延')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'748', N'SZ', N'SWZ', N'99', N'Eswatini', N'史瓦帝尼')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'752', N'SE', N'SWE', N'99', N'Sweden', N'瑞典')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'756', N'CH', N'CHE', N'99', N'Switzerland', N'瑞士')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'76', N'BR', N'BRA', N'99', N'Brazil', N'巴西')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'760', N'SY', N'SYR', N'99', N'Syrian Arab Republic', N'敘利亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'762', N'TJ', N'TJK', N'99', N'Tajikistan', N'塔吉克')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'764', N'TH', N'THA', N'99', N'Thailand', N'泰國')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'768', N'TG', N'TGO', N'99', N'Togo', N'多哥')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'772', N'TK', N'TKL', N'99', N'Tokelau', N'托克勞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'776', N'TO', N'TON', N'99', N'Tonga', N'東加')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'780', N'TT', N'TTO', N'99', N'Trinidad and Tobago', N'千里達及托巴哥')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'784', N'AE', N'ARE', N'99', N'United Arab Emirates', N'阿聯')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'788', N'TN', N'TUN', N'99', N'Tunisia', N'突尼西亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'792', N'TR', N'TUR', N'99', N'Türkiye', N'土耳其')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'795', N'TM', N'TKM', N'99', N'Turkmenistan', N'土庫曼')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'796', N'TC', N'TCA', N'99', N'Turks and Caicos Islands', N'特克斯與凱科斯群島')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'798', N'TV', N'TUV', N'99', N'Tuvalu', N'吐瓦魯')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'8', N'AL', N'ALB', N'99', N'Albania', N'阿爾巴尼亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'800', N'UG', N'UGA', N'99', N'Uganda', N'烏干達')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'804', N'UA', N'UKR', N'99', N'Ukraine', N'烏克蘭')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'807', N'MK', N'MKD', N'99', N'North Macedonia', N'北馬其頓')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'818', N'EG', N'EGY', N'99', N'Egypt', N'埃及')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'826', N'GB', N'GBR', N'99', N'United Kingdom of Great Britain and Northern Ireland', N'英國')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'831', N'GG', N'GGY', N'99', N'Guernsey', N'根西')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'832', N'JE', N'JEY', N'99', N'Jersey', N'澤西')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'833', N'IM', N'IMN', N'99', N'Isle of Man', N'曼島')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'834', N'TZ', N'TZA', N'99', N'Tanzania, United Republic of', N'坦尚尼亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'84', N'BZ', N'BLZ', N'99', N'Belize', N'貝里斯')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'840', N'US', N'USA', N'3', N'United States of America', N'美國')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'850', N'VI', N'VIR', N'99', N'Virgin Islands (U.S.)', N'美屬維京群島')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'854', N'BF', N'BFA', N'99', N'Burkina Faso', N'布吉納法索')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'858', N'UY', N'URY', N'99', N'Uruguay', N'烏拉圭')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'86', N'IO', N'IOT', N'99', N'British Indian Ocean Territory', N'英屬印度洋領地')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'860', N'UZ', N'UZB', N'99', N'Uzbekistan', N'烏茲別克')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'862', N'VE', N'VEN', N'99', N'Venezuela (Bolivarian Republic of)', N'委內瑞拉')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'876', N'WF', N'WLF', N'99', N'Wallis and Futuna', N'瓦利斯和富圖那')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'882', N'WS', N'WSM', N'99', N'Samoa', N'薩摩亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'887', N'YE', N'YEM', N'99', N'Yemen', N'葉門')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'894', N'ZM', N'ZMB', N'99', N'Zambia', N'尚比亞')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'90', N'SB', N'SLB', N'99', N'Solomon Islands', N'索羅門群島')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'92', N'VG', N'VGB', N'99', N'Virgin Islands (British)', N'英屬維京群島')
GO

INSERT INTO [dbo].[country] ([ID], [ID2], [ID3], [range], [name_en], [name_zh]) VALUES (N'96', N'BN', N'BRN', N'99', N'Brunei Darussalam', N'汶萊')
GO

COMMIT
GO


-- ----------------------------
-- Table structure for family_members
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[family_members]') AND type IN ('U'))
	DROP TABLE [dbo].[family_members]
GO

CREATE TABLE [dbo].[family_members] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [follower_num] int  NOT NULL,
  [fam_name] nvarchar(255) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [fam_gender] nvarchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [fam_title] nvarchar(30) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [deceased] bit DEFAULT 0 NULL,
  [birthdate] date  NULL,
  [lunar_birthday] nvarchar(30) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [age] nvarchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [zodiac] nvarchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [birth_time] nvarchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [city] nvarchar(255) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [area] nvarchar(255) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [address] nvarchar(255) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [phone] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [mobile] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[family_members] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'家族成員資料',
'SCHEMA', N'dbo',
'TABLE', N'family_members'
GO


-- ----------------------------
-- Records of family_members
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[family_members] ON
GO

SET IDENTITY_INSERT [dbo].[family_members] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for files
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[files]') AND type IN ('U'))
	DROP TABLE [dbo].[files]
GO

CREATE TABLE [dbo].[files] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [subject] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [word] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [reg_time] datetime DEFAULT getdate() NULL,
  [modify_time] datetime  NULL,
  [customize_data] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [paperset] nvarchar(15) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[files] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'套表列印設定',
'SCHEMA', N'dbo',
'TABLE', N'files'
GO


-- ----------------------------
-- Records of files
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[files] ON
GO

INSERT INTO [dbo].[files] ([num], [subject], [word], [reg_time], [modify_time], [customize_data], [paperset]) VALUES (N'25', N'[標準L1A]大牌位-佛光注照-長生祿位-A3(直)', N'<div class="page border" data-body-class="tblt-l a3">
<div class="content">
<div class="bg"><img alt="Alternate Text" src="./tablet-2.svg" /></div>

<div class="text">
<div class="top_text_1">{$牌位主標題}</div>

<div class="top_text_2">{orderItem.print_id}</div>

<div class="top_text_3">個</div>

<div class="right_text text-block fit-text vertical text-start border">{$右標題}</div>

<div class="mid_text text-block fit-text vertical border" style="{$mid_text_style}">{orderItem.f_num_tablet}</div>

<div class="mid_text_2 text-block fit-text vertical border">{$祈福姓名2}</div>

<div class="left_text text-block fit-text vertical text-start border" style="{$left_text_style}">{orderItem.from_id_tablet}</div>

<div class="txt_up vertical">&nbsp;</div>

<div class="txt_down vertical">&nbsp;</div>
</div>
</div>
</div>
', N'2023-03-28 00:00:00.000', N'2024-12-13 23:50:33.097', N'$牌位主標題:
$牌位副標題:
$右標題:
$祈福姓名:
$祈福姓名2:
$陽上姓名:
$編號:', N'tblt-l a3')
GO

INSERT INTO [dbo].[files] ([num], [subject], [word], [reg_time], [modify_time], [customize_data], [paperset]) VALUES (N'26', N'[標準M1A]個人大牌-佛光注照-長生祿位-A4(直)', N'<div class="page border" data-body-class="tblt-m a4">
<div class="content">
<div class="bg"><img alt="Alternate Text" src="./tablet-2.svg" /></div>

<div class="text">
<div class="top_text_1">{$牌位主標題}</div>

<div class="top_text_2">{orderItem.print_id}</div>

<div class="top_text_3">個</div>

<div class="right_text text-block fit-text vertical text-start border">{$右標題}</div>

<div class="mid_text text-block fit-text vertical border" style="{$mid_text_style}">{orderItem.f_num_tablet}</div>

<div class="mid_text_2 text-block fit-text vertical border">{$祈福姓名2}</div>

<div class="left_text text-block fit-text vertical text-start border" style="{$left_text_style}">{orderItem.from_id_tablet}</div>

<div class="txt_up vertical">&nbsp;</div>

<div class="txt_down vertical">&nbsp;</div>
</div>
</div>
</div>
', N'2023-03-28 00:00:00.000', N'2024-12-13 23:50:30.630', N'$牌位主標題:
$牌位副標題:
$右標題:
$祈福姓名:
$祈福姓名2:
$陽上姓名:
$編號:', N'tblt-m a4')
GO

INSERT INTO [dbo].[files] ([num], [subject], [word], [reg_time], [modify_time], [customize_data], [paperset]) VALUES (N'27', N'[標準M2A]個人大牌-佛光注照-長生祿位-A4(直, 合併)', N'<div class="page border" data-body-class="tblt-m a4-mrg">
<div class="content">
<div class="bg"><img alt="Alternate Text" src="./tablet-2.svg" /></div>

<div class="text">
<div class="top_text_1">{$牌位主標題}</div>

<div class="top_text_2">{orderItem.print_id}</div>

<div class="top_text_3">個</div>

<div class="right_text text-block fit-text vertical text-start border">{$右標題}</div>

<div class="mid_text text-block fit-text vertical border" style="{$mid_text_style}">{orderItem.f_num_tablet}</div>

<div class="mid_text_2 text-block fit-text vertical border">{$祈福姓名2}</div>

<div class="left_text text-block fit-text vertical text-start border" style="{$left_text_style}">{orderItem.from_id_tablet}</div>

<div class="txt_up vertical">&nbsp;</div>

<div class="txt_down vertical">&nbsp;</div>
</div>
</div>
</div>
', N'2023-03-28 00:00:00.000', N'2024-12-13 23:50:28.437', N'$牌位主標題:
$牌位副標題:
$右標題:
$祈福姓名:
$祈福姓名2:
$陽上姓名:
$編號:', N'tblt-m a4-mrg')
GO

INSERT INTO [dbo].[files] ([num], [subject], [word], [reg_time], [modify_time], [customize_data], [paperset]) VALUES (N'28', N'[標準S1A]個人中牌-佛光注照-長生祿位-A5(直)', N'<div class="page border" data-body-class="tblt-s a5">
<div class="content">
<div class="bg"><img alt="Alternate Text" src="./tablet-2.svg" /></div>

<div class="text">
<div class="top_text_1">{$牌位主標題}</div>

<div class="top_text_2">{orderItem.print_id}</div>

<div class="top_text_3">個</div>

<div class="right_text text-block fit-text vertical text-start border">{$右標題}</div>

<div class="mid_text text-block fit-text vertical border" style="{$mid_text_style}">{orderItem.f_num_tablet}</div>

<div class="mid_text_2 text-block fit-text vertical border">{$祈福姓名2}</div>

<div class="left_text text-block fit-text vertical text-start border" style="{$left_text_style}">{orderItem.from_id_tablet}</div>

<div class="txt_up vertical">&nbsp;</div>

<div class="txt_down vertical">&nbsp;</div>
</div>
</div>
</div>
', N'2023-03-28 00:00:00.000', N'2024-12-13 23:50:25.553', N'$牌位主標題:
$牌位副標題:
$右標題:
$祈福姓名:
$祈福姓名2:
$陽上姓名:
$編號:', N'tblt-s a5')
GO

INSERT INTO [dbo].[files] ([num], [subject], [word], [reg_time], [modify_time], [customize_data], [paperset]) VALUES (N'29', N'[標準S2A]個人中牌-佛光注照-長生祿位-A4(橫, 合併)', N'<div class="page border" data-body-class="tblt-s a4l-mrg">
<div class="content">
<div class="bg"><img alt="Alternate Text" src="./tablet-2.svg" /></div>

<div class="text">
<div class="top_text_1">{$牌位主標題}</div>

<div class="top_text_2">{orderItem.print_id}</div>

<div class="top_text_3">個</div>

<div class="right_text text-block fit-text vertical text-start border">{$右標題}</div>

<div class="mid_text text-block fit-text vertical border" style="{$mid_text_style}">{orderItem.f_num_tablet}</div>

<div class="mid_text_2 text-block fit-text vertical border">{$祈福姓名2}</div>

<div class="left_text text-block fit-text vertical text-start border" style="{$left_text_style}">{orderItem.from_id_tablet}</div>

<div class="txt_up vertical">&nbsp;</div>

<div class="txt_down vertical">&nbsp;</div>
</div>
</div>
</div>
', N'2023-03-28 00:00:00.000', N'2024-12-13 23:50:23.603', N'$牌位主標題:
$牌位副標題:
$右標題:
$祈福姓名:
$祈福姓名2:
$陽上姓名:
$編號:', N'tblt-s a4l-mrg')
GO

INSERT INTO [dbo].[files] ([num], [subject], [word], [reg_time], [modify_time], [customize_data], [paperset]) VALUES (N'30', N'[標準S3A]個人中牌-佛光注照-長生祿位-A3(直, 合併)', N'<div class="page border" data-body-class="tblt-s a3-mrg">
<div class="content">
<div class="bg"><img alt="Alternate Text" src="./tablet-2.svg" /></div>

<div class="text">
<div class="top_text_1">{$牌位主標題}</div>

<div class="top_text_2">{orderItem.print_id}</div>

<div class="top_text_3">個</div>

<div class="right_text text-block fit-text vertical text-start border">{$右標題}</div>

<div class="mid_text text-block fit-text vertical border" style="{$mid_text_style}">{orderItem.f_num_tablet}</div>

<div class="mid_text_2 text-block fit-text vertical border">{$祈福姓名2}</div>

<div class="left_text text-block fit-text vertical text-start border" style="{$left_text_style}">{orderItem.from_id_tablet}</div>

<div class="txt_up vertical">&nbsp;</div>

<div class="txt_down vertical">&nbsp;</div>
</div>
</div>
</div>
', N'2023-03-28 00:00:00.000', N'2024-12-13 23:50:21.727', N'$牌位主標題:
$牌位副標題:
$右標題:
$祈福姓名:
$祈福姓名2:
$陽上姓名:
$編號:', N'tblt-s a3-mrg')
GO

INSERT INTO [dbo].[files] ([num], [subject], [word], [reg_time], [modify_time], [customize_data], [paperset]) VALUES (N'31', N'[標準X1A]隨喜牌位-佛光注照-長生祿位-A4(橫)', N'<div class="page border" data-body-class="tblt-xs a4l-mrg">
<div class="content">
<div class="bg"><img alt="Alternate Text" src="./tablet-2A.svg" /></div>

<div class="text">
<div class="top_text_1">{$牌位主標題}</div>

<div class="top_text_2">{orderItem.print_id}</div>

<div class="top_text_3">&nbsp;</div>

<div class="right_text text-block fit-text vertical text-start border">{$右標題}</div>

<div class="mid_text text-block fit-text vertical border" style="{$mid_text_style}">{orderItem.f_num_tablet}</div>

<div class="mid_text_2 text-block fit-text vertical border">{$祈福姓名2}</div>

<div class="left_text text-block fit-text vertical text-start border" style="{$left_text_style}">{orderItem.from_id_tablet}</div>

<div class="txt_up vertical">&nbsp;</div>

<div class="txt_down vertical">&nbsp;</div>
</div>
</div>
</div>
', N'2023-03-28 00:00:00.000', N'2024-12-13 23:50:20.130', N'$牌位主標題:
$牌位副標題:
$右標題:
$祈福姓名:
$祈福姓名2:
$陽上姓名:
$編號:', N'tblt-xs a4l-mrg')
GO

INSERT INTO [dbo].[files] ([num], [subject], [word], [reg_time], [modify_time], [customize_data], [paperset]) VALUES (N'32', N'[標準X2A]隨喜牌位-佛光注照-長生祿位-A3(直)', N'<div class="page border" data-body-class="tblt-xs a3-mrg">
<div class="content">
<div class="bg"><img alt="Alternate Text" src="./tablet-2A.svg" /></div>

<div class="text">
<div class="top_text_1">{$牌位主標題}</div>

<div class="top_text_2">{orderItem.print_id}</div>

<div class="top_text_3">個</div>

<div class="right_text text-block fit-text vertical text-start border">{$右標題}</div>

<div class="mid_text text-block fit-text vertical border" style="{$mid_text_style}">{orderItem.f_num_tablet}</div>

<div class="mid_text_2 text-block fit-text vertical border">{$祈福姓名2}</div>

<div class="left_text text-block fit-text vertical text-start border" style="{$left_text_style}">{orderItem.from_id_tablet}</div>

<div class="txt_up vertical">&nbsp;</div>

<div class="txt_down vertical">&nbsp;</div>
</div>
</div>
</div>
', N'2023-03-28 00:00:00.000', N'2024-12-13 23:50:17.937', N'$牌位主標題:
$牌位副標題:
$右標題:
$祈福姓名:
$祈福姓名2:
$陽上姓名:
$編號:', N'tblt-xs a3-mrg')
GO

INSERT INTO [dbo].[files] ([num], [subject], [word], [reg_time], [modify_time], [customize_data], [paperset]) VALUES (N'33', N'[標準L1B]大牌位-佛力超薦-往生蓮位-A3(直)', N'<div class="page border" data-body-class="tblt-l a3">
<div class="content">
<div class="bg"><img alt="Alternate Text" src="./tablet-1.svg" /></div>

<div class="text">
<div class="top_text_1">{$牌位主標題}</div>

<div class="top_text_2">{orderItem.print_id}</div>

<div class="top_text_3">個</div>

<div class="right_text text-block fit-text vertical text-start border">{$右標題}</div>

<div class="mid_text text-block fit-text vertical border" style="{$mid_text_style}">{orderItem.f_num_tablet}</div>

<div class="mid_text_2 text-block fit-text vertical border">{$祈福姓名2}</div>

<div class="left_text text-block fit-text vertical text-start border" style="{$left_text_style}">{orderItem.from_id_tablet}</div>

<div class="txt_up vertical">陽上</div>

<div class="txt_down vertical">拜薦</div>
</div>
</div>
</div>
', N'2023-03-28 00:00:00.000', N'2024-12-13 23:50:15.683', N'$牌位主標題:
$牌位副標題:
$右標題:
$祈福姓名:
$祈福姓名2:
$陽上姓名:
$編號:', N'tblt-l a3')
GO

INSERT INTO [dbo].[files] ([num], [subject], [word], [reg_time], [modify_time], [customize_data], [paperset]) VALUES (N'34', N'[標準M1B]個人大牌-佛力超薦-往生蓮位-A4(直)', N'<div class="page border" data-body-class="tblt-m a4">
<div class="content">
<div class="bg"><img alt="Alternate Text" src="./tablet-1.svg" /></div>

<div class="text">
<div class="top_text_1">{$牌位主標題}</div>

<div class="top_text_2">{orderItem.print_id}</div>

<div class="top_text_3">個</div>

<div class="right_text text-block fit-text vertical text-start border">{$右標題}</div>

<div class="mid_text text-block fit-text vertical border" style="{$mid_text_style}">{orderItem.f_num_tablet}</div>

<div class="mid_text_2 text-block fit-text vertical border">{$祈福姓名2}</div>

<div class="left_text text-block fit-text vertical text-start border" style="{$left_text_style}">{orderItem.from_id_tablet}</div>

<div class="txt_up vertical">陽上</div>

<div class="txt_down vertical">拜薦</div>
</div>
</div>
</div>
', N'2023-03-28 00:00:00.000', N'2024-12-13 23:50:13.433', N'$牌位主標題:
$牌位副標題:
$右標題:
$祈福姓名:
$祈福姓名2:
$陽上姓名:
$編號:', N'tblt-m a4')
GO

INSERT INTO [dbo].[files] ([num], [subject], [word], [reg_time], [modify_time], [customize_data], [paperset]) VALUES (N'35', N'[標準M2B]個人大牌-佛力超薦-往生蓮位-A4(直, 合併)', N'<div class="page border" data-body-class="tblt-m a4-mrg">
<div class="content">
<div class="bg"><img alt="Alternate Text" src="./tablet-1.svg" /></div>

<div class="text">
<div class="top_text_1">{$牌位主標題}</div>

<div class="top_text_2">{orderItem.print_id}</div>

<div class="top_text_3">個</div>

<div class="right_text text-block fit-text vertical text-start border">{$右標題}</div>

<div class="mid_text text-block fit-text vertical border" title="祈福姓名" style="{$mid_text_style}">{orderItem.f_num_tablet}</div>

<div class="mid_text_2 text-block fit-text vertical border" title="祈福姓名2">{$祈福姓名2}</div>

<div class="left_text text-block fit-text vertical text-start border" title="陽上姓名" style="{$left_text_style}">{orderItem.from_id_tablet}</div>

<div class="txt_up vertical">陽上</div>

<div class="txt_down vertical">拜薦</div>
</div>
</div>
</div>
', N'2023-03-28 00:00:00.000', N'2024-12-13 23:50:11.073', N'$牌位主標題:
$牌位副標題:
$右標題:
$祈福姓名:
$祈福姓名2:
$陽上姓名:
$編號:', N'tblt-m a4-mrg')
GO

INSERT INTO [dbo].[files] ([num], [subject], [word], [reg_time], [modify_time], [customize_data], [paperset]) VALUES (N'36', N'[標準S1B]個人中牌-佛力超薦-往生蓮位-A5(直)', N'<div class="page border" data-body-class="tblt-s a5">
<div class="content">
<div class="bg"><img alt="Alternate Text" src="./tablet-1.svg" /></div>

<div class="text">
<div class="top_text_1">{$牌位主標題}</div>

<div class="top_text_2">{orderItem.print_id}</div>

<div class="top_text_3">個</div>

<div class="right_text text-block fit-text vertical text-start border">{$右標題}</div>

<div class="mid_text text-block fit-text vertical border" style="{$mid_text_style}">{orderItem.f_num_tablet}</div>

<div class="mid_text_2 text-block fit-text vertical border">{$祈福姓名2}</div>

<div class="left_text text-block fit-text vertical text-start border" style="{$left_text_style}">{orderItem.from_id_tablet}</div>

<div class="txt_up vertical">陽上</div>

<div class="txt_down vertical">拜薦</div>
</div>
</div>
</div>
', N'2023-03-28 00:00:00.000', N'2024-12-13 23:50:08.320', N'$牌位主標題:
$牌位副標題:
$右標題:
$祈福姓名:
$祈福姓名2:
$陽上姓名:
$編號:', N'tblt-s a5')
GO

INSERT INTO [dbo].[files] ([num], [subject], [word], [reg_time], [modify_time], [customize_data], [paperset]) VALUES (N'37', N'[標準S2B]個人中牌-佛力超薦-往生蓮位-A4(橫, 合併)', N'<div class="page border" data-body-class="tblt-s a4l-mrg">
<div class="content">
<div class="bg"><img alt="Alternate Text" src="./tablet-1.svg" /></div>

<div class="text">
<div class="top_text_1">{$牌位主標題}</div>

<div class="top_text_2">{orderItem.print_id}</div>

<div class="top_text_3">個</div>

<div class="right_text text-block fit-text vertical text-start border">{$右標題}</div>

<div class="mid_text text-block fit-text vertical border" style="{$mid_text_style}">{orderItem.f_num_tablet}</div>

<div class="mid_text_2 text-block fit-text vertical border">{$祈福姓名2}</div>

<div class="left_text text-block fit-text vertical text-start border" style="{$left_text_style}">{orderItem.from_id_tablet}</div>

<div class="txt_up vertical">陽上</div>

<div class="txt_down vertical">拜薦</div>
</div>
</div>
</div>
', N'2023-03-28 00:00:00.000', N'2024-12-13 23:50:06.263', N'$牌位主標題:
$牌位副標題:
$右標題:
$祈福姓名:
$祈福姓名2:
$陽上姓名:
$編號:', N'tblt-s a4l-mrg')
GO

INSERT INTO [dbo].[files] ([num], [subject], [word], [reg_time], [modify_time], [customize_data], [paperset]) VALUES (N'38', N'[標準S3B]個人中牌-佛力超薦-往生蓮位-A3(直, 合併)', N'<div class="page border" data-body-class="tblt-s a3-mrg">
<div class="content">
<div class="bg"><img alt="Alternate Text" src="./tablet-1.svg" /></div>

<div class="text">
<div class="top_text_1">{$牌位主標題}</div>

<div class="top_text_2">{orderItem.print_id}</div>

<div class="top_text_3">個</div>

<div class="right_text text-block fit-text vertical text-start border">{$右標題}</div>

<div class="mid_text text-block fit-text vertical border" style="{$mid_text_style}">{orderItem.f_num_tablet}</div>

<div class="mid_text_2 text-block fit-text vertical border">{$祈福姓名2}</div>

<div class="left_text text-block fit-text vertical text-start border" style="{$left_text_style}">{orderItem.from_id_tablet}</div>

<div class="txt_up vertical">陽上</div>

<div class="txt_down vertical">拜薦</div>
</div>
</div>
</div>
', N'2023-03-28 00:00:00.000', N'2024-12-13 23:50:04.340', N'$牌位主標題:
$牌位副標題:
$右標題:
$祈福姓名:
$祈福姓名2:
$陽上姓名:
$編號:', N'tblt-s a3-mrg')
GO

INSERT INTO [dbo].[files] ([num], [subject], [word], [reg_time], [modify_time], [customize_data], [paperset]) VALUES (N'39', N'[標準X1B]隨喜牌位-佛力超薦-往生蓮位-A4(橫)', N'<div class="page border" data-body-class="tblt-xs a4l-mrg">
<div class="content">
<div class="bg"><img alt="Alternate Text" src="./tablet-1A.svg" /></div>

<div class="text">
<div class="top_text_1">{$牌位主標題}</div>

<div class="top_text_2">{orderItem.print_id}</div>

<div class="top_text_3">&nbsp;</div>

<div class="right_text text-block fit-text vertical text-start border">{$右標題}</div>

<div class="mid_text text-block fit-text vertical border" style="{$mid_text_style}">{orderItem.f_num_tablet}</div>

<div class="mid_text_2 text-block fit-text vertical border">{$祈福姓名2}</div>

<div class="left_text text-block fit-text vertical text-start border" style="{$left_text_style}">{orderItem.from_id_tablet}</div>

<div class="txt_up vertical">陽上</div>

<div class="txt_down vertical">拜薦</div>
</div>
</div>
</div>
', N'2023-03-28 00:00:00.000', N'2024-12-13 23:50:02.170', N'$牌位主標題:
$牌位副標題:
$右標題:
$祈福姓名:
$祈福姓名2:
$陽上姓名:
$編號:', N'tblt-xs a4l-mrg')
GO

INSERT INTO [dbo].[files] ([num], [subject], [word], [reg_time], [modify_time], [customize_data], [paperset]) VALUES (N'40', N'[標準X2B]隨喜牌位-佛力超薦-往生蓮位-A3(直)', N'<div class="page border" data-body-class="tblt-xs a3-mrg">
<div class="content">
<div class="bg"><img alt="Alternate Text" src="./tablet-1A.svg" /></div>

<div class="text">
<div class="top_text_1">{$牌位主標題}</div>

<div class="top_text_2">{orderItem.print_id}</div>

<div class="top_text_3">個</div>

<div class="right_text text-block fit-text vertical text-start border">{$右標題}</div>

<div class="mid_text text-block fit-text vertical border" style="{$mid_text_style}">{orderItem.f_num_tablet}</div>

<div class="mid_text_2 text-block fit-text vertical border">{$祈福姓名2}</div>

<div class="left_text text-block fit-text vertical text-start border" style="{$left_text_style}">{orderItem.from_id_tablet}</div>

<div class="txt_up vertical">陽上</div>

<div class="txt_down vertical">拜薦</div>
</div>
</div>
</div>
', N'2023-03-28 00:00:00.000', N'2024-12-13 23:49:59.323', N'$牌位主標題:
$牌位副標題:
$右標題:
$祈福姓名:
$祈福姓名2:
$陽上姓名:
$編號:', N'tblt-xs a3-mrg')
GO

INSERT INTO [dbo].[files] ([num], [subject], [word], [reg_time], [modify_time], [customize_data], [paperset]) VALUES (N'44', N'[標準M3A]個人大牌-佛光注照-長生祿位-A3(横, 合併)', N'<div class="page border" data-body-class="tblt-m a3-mrg">
<div class="content">
<div class="bg"><img alt="Alternate Text" src="./tablet-2.svg" /></div>

<div class="text">
<div class="top_text_1">{$牌位主標題}</div>

<div class="top_text_2">{orderItem.print_id}</div>

<div class="top_text_3">個</div>

<div class="right_text text-block fit-text vertical text-start border">{$右標題}</div>

<div class="mid_text text-block fit-text vertical border" style="{$mid_text_style}">{orderItem.f_num_tablet}</div>

<div class="mid_text_2 text-block fit-text vertical border">{$祈福姓名2}</div>

<div class="left_text text-block fit-text vertical text-start border" style="{$left_text_style}">{orderItem.from_id_tablet}</div>

<div class="txt_up vertical">&nbsp;</div>

<div class="txt_down vertical">&nbsp;</div>
</div>
</div>
</div>
', N'2023-04-26 00:00:00.000', N'2024-12-13 23:49:12.333', N'$牌位主標題:
$牌位副標題:
$右標題:
$祈福姓名:
$祈福姓名2:
$陽上姓名:
$編號:', N'tblt-m a3-mrg')
GO

INSERT INTO [dbo].[files] ([num], [subject], [word], [reg_time], [modify_time], [customize_data], [paperset]) VALUES (N'45', N'[標準M3B]個人大牌-佛力超薦-往生蓮位-A3(横, 合併)', N'<div class="page border" data-body-class="tblt-m a3-mrg">
<div class="content">
<div class="bg"><img alt="Alternate Text" src="./tablet-1.svg" /></div>

<div class="text">
<div class="top_text_1">{$牌位主標題}</div>

<div class="top_text_2">{orderItem.print_id}</div>

<div class="top_text_3">&nbsp;</div>

<div class="right_text text-block fit-text vertical text-start border">{$右標題}</div>

<div class="mid_text text-block fit-text vertical border" style="{$mid_text_style}">{orderItem.f_num_tablet}</div>

<div class="mid_text_2 text-block fit-text vertical border">{$祈福姓名2}</div>

<div class="left_text text-block fit-text vertical text-start border"style="{$left_text_style}">{orderItem.from_id_tablet}</div>

<div class="txt_up vertical">陽上</div>

<div class="txt_down vertical">拜薦</div>
</div>
</div>
</div>
', N'2023-04-26 00:00:00.000', N'2024-12-13 23:17:11.763', N'$牌位主標題:
$牌位副標題:
$右標題:
$祈福姓名:
$祈福姓名2:
$陽上姓名:
$編號:', N'tblt-l a3-mrg')
GO

INSERT INTO [dbo].[files] ([num], [subject], [word], [reg_time], [modify_time], [customize_data], [paperset]) VALUES (N'207', N'[標準L2A]大牌位-佛光注照-長生祿位-特-A3(直)', N'<div class="page border" data-body-class="tblt-l a3">
<div class="content">
<div class="bg"><img alt="Alternate Text" src="./tablet-2.svg" /></div>

<div class="text">
<div class="top_text_1">{$牌位主標題}</div>

<div class="top_text_2">{orderItem.print_id}</div>

<div class="top_text_3">個</div>

<div class="right_text text-block fit-text vertical text-start border">{$右標題}</div>

<div class="mid_text text-block fit-text vertical border" style="{$mid_text_style}">{orderItem.f_num_tablet}</div>

<div class="mid_text_2 text-block fit-text vertical border">{$祈福姓名2}</div>

<div class="left_text text-block fit-text vertical text-start border" style="{$left_text_style}">{orderItem.from_id_tablet}</div>

<div class="txt_up vertical">&nbsp;</div>

<div class="txt_down vertical">&nbsp;</div>
</div>
</div>
</div>
', N'2024-11-29 00:00:00.000', N'2024-12-13 23:49:07.337', N'$牌位主標題:
$牌位副標題:
$右標題:
$祈福姓名:
$祈福姓名2:合家
$陽上姓名:
$編號:', N'tblt-l a3 l2a')
GO

INSERT INTO [dbo].[files] ([num], [subject], [word], [reg_time], [modify_time], [customize_data], [paperset]) VALUES (N'210', N'[標準L2B]大牌位-佛力超薦-往生蓮位-特-A3(直)', N'<div class="page border" data-body-class="tblt-l a3">
<div class="content">
<div class="bg"><img alt="Alternate Text" src="./tablet-1.svg" /></div>

<div class="text">
<div class="top_text_1">{$牌位主標題}</div>

<div class="top_text_2">{orderItem.print_id}</div>

<div class="top_text_3">個</div>

<div class="right_text text-block fit-text vertical text-start border">{$右標題}</div>

<div class="mid_text text-block fit-text vertical border" style="{$mid_text_style}">{orderItem.f_num_tablet}</div>

<div class="mid_text_2 text-block fit-text vertical border">{$祈福姓名2}</div>

<div class="mid_text_3 text-block fit-text vertical border">亡者 {$祈福姓名3}</div>

<div class="mid_text_4 text-block fit-text vertical border">亡者 {$祈福姓名4}</div>

<div class="left_text text-block fit-text vertical text-start border" style="{$left_text_style}">{orderItem.from_id_tablet}</div>

<div class="txt_up vertical">陽上</div>

<div class="txt_down vertical">拜薦</div>
</div>
</div>
</div>
', N'2024-11-29 00:00:00.000', N'2024-12-13 23:48:58.593', N'$牌位主標題:
$牌位副標題:
$右標題:
$祈福姓名:
$祈福姓名2:氏門中歷代宗親暨眾冤親債主
$祈福姓名3:
$祈福姓名4:
$陽上姓名:
$編號:', N'tblt-l a3 l2b')
GO

SET IDENTITY_INSERT [dbo].[files] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for followers
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[followers]') AND type IN ('U'))
	DROP TABLE [dbo].[followers]
GO

CREATE TABLE [dbo].[followers] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [f_number] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [u_name] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [sex] nvarchar(2) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [identity_type] int  NULL,
  [birthday] datetime  NULL,
  [phone] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [email] nvarchar(200) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [refugedate] datetime  NULL,
  [refuge_name] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [address] nvarchar(200) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [leader] int  NULL,
  [socialid1] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [socialid2] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [tab] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [contactor] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [contactor_phone] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [blood] nvarchar(2) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [customize_data] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [introducer] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [refuge_area] nvarchar(25) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [id_code] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [passport] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [cellphone] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [reg_time] datetime DEFAULT getdate() NULL,
  [admin_log] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [join_date] datetime  NULL,
  [country] nvarchar(5) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [appellation_id] int  NULL,
  [follower_hash] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [search_keywords] varchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[followers] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'信眾資料',
'SCHEMA', N'dbo',
'TABLE', N'followers'
GO


-- ----------------------------
-- Records of followers
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[followers] ON
GO

SET IDENTITY_INSERT [dbo].[followers] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for followers_tablet
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[followers_tablet]') AND type IN ('U'))
	DROP TABLE [dbo].[followers_tablet]
GO

CREATE TABLE [dbo].[followers_tablet] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [f_num] int  NULL,
  [type] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [title] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[followers_tablet] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'信眾牌位資料',
'SCHEMA', N'dbo',
'TABLE', N'followers_tablet'
GO


-- ----------------------------
-- Records of followers_tablet
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[followers_tablet] ON
GO

SET IDENTITY_INSERT [dbo].[followers_tablet] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for GuaDanOrder
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[GuaDanOrder]') AND type IN ('U'))
	DROP TABLE [dbo].[GuaDanOrder]
GO

CREATE TABLE [dbo].[GuaDanOrder] (
  [StartDate] date  NULL,
  [EndDate] date  NULL,
  [CreateUser] int  NULL,
  [CreatedAt] datetime2(7)  NULL,
  [UpdatedAt] datetime2(7)  NULL,
  [Notes] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [GuaDanOrderNo] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [BookerFollowerNum] int  NULL,
  [BookerName] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [BookerPhone] nvarchar(12) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [IsDeleted] bit DEFAULT 0 NOT NULL,
  [Uuid] uniqueidentifier  NOT NULL,
  [ActivityNum] int  NULL,
  [IsCancel] bit DEFAULT 0 NOT NULL
)
GO

ALTER TABLE [dbo].[GuaDanOrder] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of GuaDanOrder
-- ----------------------------
BEGIN TRANSACTION
GO

COMMIT
GO


-- ----------------------------
-- Table structure for GuaDanOrderGuest
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[GuaDanOrderGuest]') AND type IN ('U'))
	DROP TABLE [dbo].[GuaDanOrderGuest]
GO

CREATE TABLE [dbo].[GuaDanOrderGuest] (
  [GuaDanOrderNo] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [FollowerNum] int  NULL,
  [IsDeleted] bit DEFAULT 0 NOT NULL,
  [Uuid] uniqueidentifier DEFAULT newid() NOT NULL,
  [RoomUuid] uniqueidentifier  NULL,
  [BedUuid] uniqueidentifier  NULL,
  [CheckInAt] date  NULL,
  [CheckOutAt] date  NULL,
  [StatusCode] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [OrderUuid] uniqueidentifier  NULL
)
GO

ALTER TABLE [dbo].[GuaDanOrderGuest] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of GuaDanOrderGuest
-- ----------------------------
BEGIN TRANSACTION
GO

COMMIT
GO


-- ----------------------------
-- Table structure for GuadanTimeSetting
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[GuadanTimeSetting]') AND type IN ('U'))
	DROP TABLE [dbo].[GuadanTimeSetting]
GO

CREATE TABLE [dbo].[GuadanTimeSetting] (
  [Id] uniqueidentifier  NOT NULL,
  [EarliestCheckIn] nvarchar(5) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [LatestCheckOut] nvarchar(5) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [IsActive] bit DEFAULT 1 NOT NULL,
  [CreatedAt] datetime  NULL,
  [UpdatedAt] datetime  NULL
)
GO

ALTER TABLE [dbo].[GuadanTimeSetting] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of GuadanTimeSetting
-- ----------------------------
BEGIN TRANSACTION
GO

COMMIT
GO


-- ----------------------------
-- Table structure for item
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[item]') AND type IN ('U'))
	DROP TABLE [dbo].[item]
GO

CREATE TABLE [dbo].[item] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [title] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [url] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [target] nvarchar(2) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [price] nvarchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [demo] nvarchar(255) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [other] nvarchar(255) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [root] int DEFAULT 0 NULL,
  [range] int  NULL,
  [other_url] nvarchar(255) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [s_id] nvarchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[item] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'選項設定檔',
'SCHEMA', N'dbo',
'TABLE', N'item'
GO


-- ----------------------------
-- Records of item
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[item] ON
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'1', N'權限', NULL, N'A', NULL, N'權限管理', NULL, N'0', N'10', NULL, NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'2', N'使用者登錄', N'~/admin/user/reg.aspx', N'A', N'', N'管理者資料新增', N'', N'1', N'2', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'3', N'使用者管理', N'~/admin/user/index.aspx', N'A', N'', N'管理者資料查詢、修改、刪除', N'', N'1', N'3', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'4', N'選項', NULL, N'A', NULL, N'選項管理', NULL, N'0', N'8', NULL, NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'5', N'選項登錄', N'~/admin/item/index.aspx', N'A', NULL, N'選項資料新增', NULL, N'4', N'5', NULL, NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'7', N'選項排序', N'~/admin/item/range.aspx', N'A', NULL, N'設定主選項及次選項的排序', NULL, N'4', N'36', NULL, NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'8', N'群組登錄', N'~/admin/user/group_reg.aspx', N'A', NULL, N'登錄群組及權限設定', NULL, N'1', N'5', NULL, NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'9', N'群組資料', N'~/admin/user/group_show.aspx', N'A', N'', N'群組資料管理', N'', N'1', N'4', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'10', N'後台設定', N'~/admin/item/setting.aspx', N'A', NULL, N'設定編輯器圖片路徑、公司信箱、公司名稱…相關設定', NULL, N'4', N'37', NULL, NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'11', N'變更管理密碼', N'~/admin/user/pass_edit.aspx', N'A', NULL, N'變更登錄後端之密碼', NULL, N'1', N'74', NULL, NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'12', N'操作記錄查詢', N'~/admin/user/log.aspx', N'A', N'', N'', N'', N'1', N'123', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'20', N'公告', N'', N'A', N'', N'', N'', N'0', N'12', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'21', N'公告管理', N'~/admin/news/index.aspx', N'A', N'', N'', N'', N'20', N'126', N'~/admin/news/news_reg.aspx', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'22', N'公告分類管理', N'~/admin/news/kind_reg.aspx', N'A', N'', N'', N'', N'20', N'125', N'~/admin/news/range.aspx,~/admin/news/range2.aspx', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'23', N'人事', N'', N'A', N'', N'', N'', N'0', N'11', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'24', N'人員組別管理', N'~/admin/hr/kind_reg.aspx', N'A', N'', N'', N'', N'23', N'129', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'25', N'職稱管理', N'~/admin/hr/title_reg.aspx', N'A', N'', N'', N'', N'23', N'130', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'26', N'人員管理', N'~/admin/hr/index.aspx', N'A', N'', N'', N'', N'23', N'131', N'~/admin/hr/reg.aspx', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'27', N'考勤', N'~/admin/hr/index2.aspx', N'A', N'', N'', N'', N'23', N'132', N'~/admin/hr/attendances.aspx', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'28', N'信眾', N'', N'A', N'', N'', N'', N'0', N'1', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'29', N'信眾資料', N'~/admin/follower/index.aspx', N'A', N'', N'', N'', N'28', N'134', N'~/admin/follower/reg.aspx', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'30', N'公告檢視', N'~/admin/news/list.aspx', N'A', N'', N'', N'', N'20', N'134', N'~/admin/news/reg.aspx', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'31', N'活動', N'', N'A', N'', N'', N'', N'0', N'3', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'34', N'活動詳細分類', N'~/admin/activity/kind_reg.aspx', N'A', N'', N'', N'', N'31', N'139', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'35', N'活動管理', N'~/admin/activity/index.aspx', N'A', N'', N'', N'', N'31', N'140', N'~/admin/activity/reg.aspx', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'36', N'基本資料', N'', N'A', N'', N'', N'', N'0', N'2', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'37', N'套表列印設定', N'~/admin/files/index.aspx', N'A', N'', N'', N'', N'36', N'141', N'~/admin/files/reg.aspx', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'38', N'報名', N'~/admin/order/index.aspx', N'A', N'', N'', N'', N'0', N'4', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'39', N'報名管理', N'~/admin/order/index.aspx', N'A', N'', N'', N'', N'38', N'143', N'~/admin/order/reg.aspx,~/admin/order/bed_reg.aspx', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'40', N'庫存', N'', N'A', N'', N'', N'', N'0', N'5', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'41', N'倉庫資料維護', N'~/admin/stock/kind_reg.aspx', N'A', N'', N'', N'', N'40', N'145', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'42', N'庫存管理', N'~/admin/stock/index.aspx', N'A', N'', N'', N'', N'40', N'147', N'~/admin/stock/news_reg.aspx', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'43', N'帳務', N'', N'A', N'', N'', N'', N'0', N'13', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'44', N'收支項目維護', N'~/admin/accounting/kind_reg.aspx', N'A', N'', N'', N'', N'43', N'148', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'45', N'收支帳戶維護', N'~/admin/accounting/kind_reg2.aspx', N'A', N'', N'', N'', N'43', N'149', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'46', N'專案', N'', N'A', N'', N'', N'', N'0', N'9', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'47', N'類別管理', N'~/admin/project/kind_reg.aspx', N'A', N'', N'', N'', N'46', N'151', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'48', N'收支管理', N'~/admin/accounting/index.aspx', N'A', N'', N'', N'', N'43', N'152', N'~/admin/accounting/news_reg.aspx', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'49', N'專案管理', N'~/admin/project/index.aspx', N'A', N'', N'', N'', N'46', N'153', N'~/admin/project/news_reg.aspx,~/admin/project/update.aspx,~/admin/project/reg.aspx', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'50', N'贊助報告', N'~/admin/project/list.aspx', N'A', N'', N'', N'', N'46', N'154', N'~/admin/project/news_reg.aspx', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'51', N'品項分類管理', N'~/admin/activity/itemKind.aspx', N'A', N'', N'', N'', N'36', N'142', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'52', N'品項管理', N'~/admin/activity/index2.aspx', N'A', N'', N'', N'', N'36', N'143', N'~/admin/activity/item_reg.aspx', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'53', N'人員匯入', N'~/admin/hr/import.aspx', N'A', N'', N'', N'', N'23', N'128', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'54', N'信眾匯入', N'~/admin/follower/import.aspx', N'A', N'', N'', N'', N'28', N'133', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'55', N'掛單', N'', N'A', N'', N'', N'', N'0', N'7', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'56', N'房間管理', N'~/admin/bed/kind_reg.aspx', N'A', N'', N'', N'', N'55', N'160', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'57', N'報到名單​', N'~/admin/order/index2.aspx', N'A', N'', N'', N'', N'38', N'161', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'58', N'活動主類型', N'~/admin/activity/kind_reg2.aspx', N'A', N'', N'', N'', N'31', N'138', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'59', N'供應商', N'', N'A', N'', N'', N'', N'0', N'14', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'60', N'供應商分類管理', N'~/admin/supplier/kind_reg.aspx', N'A', N'', N'', N'', N'59', N'164', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'61', N'供應商管理', N'~/admin/supplier/index.aspx', N'A', N'', N'', N'', N'59', N'163', N'~/admin/supplier/reg.aspx', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'62', N'庫存異動原因', N'~/admin/stock/reason_reg.aspx', N'A', N'', N'', N'', N'40', N'146', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'63', N'牌位查詢列印', N'~/admin/printpw/yulan.aspx', N'A', N'', N'各活動的牌位查詢列印', N'', N'31', N'160', N'~/admin/printpw/index.aspx', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'64', N'疏文查詢', N'~/admin/shuwen/shuwen.aspx', N'A', N'', N'', N'', N'38', N'165', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'65', N'入帳沖帳', N'', N'A', N'', N'', N'', N'0', N'15', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'66', N'登錄匯款資料', N'~/admin/transfer/register.aspx', N'B', N'', N'', N'', N'65', N'167', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'67', N'出納:核對匯款人', N'~/admin/transfer/verify1.aspx', N'A', N'', N'', N'', N'65', N'168', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'68', N'出納:核對金額', N'~/admin/transfer/verify2.aspx', N'A', N'', N'', N'', N'65', N'169', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'69', N'個人-沖帳流程', N'~/admin/transfer/personal_reconcile.aspx', N'A', N'', N'', N'', N'65', N'170', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'70', N'共同-沖帳流程', N'~/admin/transfer/group_reconcile.aspx', N'A', N'', N'', N'', N'65', N'171', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'71', N'餘額核銷', N'~/admin/transfer/balance_reconcile.aspx', N'A', N'', N'', N'', N'65', N'173', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'72', N'餘額核銷查詢', N'~/admin/transfer/balance_reconcile_query.aspx', N'A', N'', N'', N'', N'65', N'174', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'73', N'沖帳查詢', N'~/admin/transfer/verify_order_record_query.aspx', N'A', N'', N'', N'', N'65', N'172', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'74', N'匯款/沖帳管理', N'~/admin/transfer/index.aspx', N'A', N'', N'', N'', N'65', N'166', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'75', N'掛單統計', N'~/admin/guadan/statistics.aspx', N'A', NULL, NULL, NULL, N'55', N'173', NULL, NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'76', N'掛單時間參數設置', N'~/admin/guadan/guadantime/timeindex.aspx', N'A', NULL, NULL, N'', N'55', N'174', N'~/admin/guadan/guadantime/timeset.aspx,~/admin/guadan/guadantime/edit.aspx', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'77', N'掛單統計報表', N'~/admin/guadan/statistics_table.aspx', N'A', NULL, NULL, NULL, N'55', N'173', NULL, NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'78', N'掛單蓮友', N'~/admin/guadan/guest/index.aspx', N'A', NULL, NULL, NULL, N'55', N'171', NULL, NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'79', N'客房管理', N'~/admin/region/bed/index.aspx', N'A', NULL, NULL, NULL, N'55', N'168', NULL, NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'80', N'床位和掛單狀態管理', N'~/admin/region/bed/bedstatus/index.aspx', N'A', NULL, NULL, NULL, N'65', N'169', N'~/admin/region/bed/bedstatus/create.aspx', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'81', N'掛單資料', N'~/admin/guadan/index.aspx', N'A', NULL, NULL, NULL, N'55', N'170', N'~/admin/guadan/view.aspx,~/admin/guadan/update.aspx', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'82', N'新建掛單', N'~/admin/guadan/create.aspx', N'A', NULL, NULL, NULL, N'55', N'169', NULL, NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'83', N'報名統計-1', N'~/admin/pivot/pivot-01.aspx', N'A', N'', N'', N'', N'38', N'175', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'84', N'報名統計-2', N'~/admin/pivot/query.aspx', N'A', N'', N'', N'', N'38', N'176', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'85', N'區域管理', N'', N'A', N'', N'', N'', N'0', N'6', N'', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'86', N'區域資料', N'~/admin/region/index.aspx', N'A', N'', N'', N'', N'85', N'178', N'~/admin/region/handle_bed_in_used.aspx', NULL)
GO

INSERT INTO [dbo].[item] ([num], [title], [url], [target], [price], [demo], [other], [root], [range], [other_url], [s_id]) VALUES (N'87', N'排版設計', N'~/admin/item/TabletDesigner.aspx', N'A', N'', N'', N'', N'36', N'179', N'', NULL)
GO

SET IDENTITY_INSERT [dbo].[item] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for member
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[member]') AND type IN ('U'))
	DROP TABLE [dbo].[member]
GO

CREATE TABLE [dbo].[member] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [f_num] int  NULL,
  [m_number] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [u_name] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [sex] nvarchar(2) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [id_code] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [birthday] datetime  NULL,
  [blood] nvarchar(2) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [educational] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [refugedate] datetime  NULL,
  [refuge_name] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [refuge_area] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [admin_num] int  NULL,
  [takedate] datetime  NULL,
  [leavedate] datetime  NULL,
  [group_kind] int  NULL,
  [title_kind] int  NULL,
  [salary] real  NULL,
  [phone] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [com_email] nvarchar(200) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [email] nvarchar(200) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [contact] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [address1] nvarchar(200) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [address2] nvarchar(200) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [reg_time] datetime DEFAULT getdate() NULL,
  [pic1] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[member] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'人員主檔',
'SCHEMA', N'dbo',
'TABLE', N'member'
GO


-- ----------------------------
-- Records of member
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[member] ON
GO

SET IDENTITY_INSERT [dbo].[member] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for member_check
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[member_check]') AND type IN ('U'))
	DROP TABLE [dbo].[member_check]
GO

CREATE TABLE [dbo].[member_check] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [mem_num] int  NULL,
  [check_date] date  NULL,
  [check_time] time(3)  NULL,
  [check_type] int  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [login_type] int  NULL,
  [login_ip] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [hour] int  NULL
)
GO

ALTER TABLE [dbo].[member_check] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'考勤',
'SCHEMA', N'dbo',
'TABLE', N'member_check'
GO


-- ----------------------------
-- Records of member_check
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[member_check] ON
GO

SET IDENTITY_INSERT [dbo].[member_check] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for member_group
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[member_group]') AND type IN ('U'))
	DROP TABLE [dbo].[member_group]
GO

CREATE TABLE [dbo].[member_group] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [kind] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [starttime] time  NULL,
  [offtime] time  NULL,
  [resttime] int  NULL,
  [root] int DEFAULT 0 NULL,
  [range] int  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[member_group] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'人員組別管理',
'SCHEMA', N'dbo',
'TABLE', N'member_group'
GO


-- ----------------------------
-- Records of member_group
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[member_group] ON
GO

SET IDENTITY_INSERT [dbo].[member_group] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for member_title
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[member_title]') AND type IN ('U'))
	DROP TABLE [dbo].[member_title]
GO

CREATE TABLE [dbo].[member_title] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [kind] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [root] int DEFAULT 0 NULL,
  [range] int  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [status] nvarchar(1) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[member_title] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'職稱管理',
'SCHEMA', N'dbo',
'TABLE', N'member_title'
GO


-- ----------------------------
-- Records of member_title
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[member_title] ON
GO

SET IDENTITY_INSERT [dbo].[member_title] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for news
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[news]') AND type IN ('U'))
	DROP TABLE [dbo].[news]
GO

CREATE TABLE [dbo].[news] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [subject] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [kind] int  NULL,
  [status] nvarchar(1) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [selltime1] datetime  NULL,
  [selltime2] datetime  NULL,
  [uptime] datetime DEFAULT CONVERT([varchar],getdate(),(111)) NULL,
  [topping] nvarchar(1) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [word] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [reg_time] datetime DEFAULT getdate() NULL,
  [range] int  NULL,
  [author] int  NULL,
  [activity_num] int  NULL
)
GO

ALTER TABLE [dbo].[news] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'公告資料主檔',
'SCHEMA', N'dbo',
'TABLE', N'news'
GO


-- ----------------------------
-- Records of news
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[news] ON
GO

SET IDENTITY_INSERT [dbo].[news] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for news_files
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[news_files]') AND type IN ('U'))
	DROP TABLE [dbo].[news_files]
GO

CREATE TABLE [dbo].[news_files] (
  [num] nvarchar(14) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [news_id] int  NOT NULL,
  [pic1] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [reg_time] datetime DEFAULT getdate() NULL,
  [pic_name] nvarchar(150) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [pic_type] nvarchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[news_files] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'公告資料-附件檔',
'SCHEMA', N'dbo',
'TABLE', N'news_files'
GO


-- ----------------------------
-- Records of news_files
-- ----------------------------
BEGIN TRANSACTION
GO

COMMIT
GO


-- ----------------------------
-- Table structure for news_kind
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[news_kind]') AND type IN ('U'))
	DROP TABLE [dbo].[news_kind]
GO

CREATE TABLE [dbo].[news_kind] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [kind] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [root] int DEFAULT 0 NULL,
  [range] int  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [status] nvarchar(1) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[news_kind] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'公告分類',
'SCHEMA', N'dbo',
'TABLE', N'news_kind'
GO


-- ----------------------------
-- Records of news_kind
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[news_kind] ON
GO

SET IDENTITY_INSERT [dbo].[news_kind] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for PostCity
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[PostCity]') AND type IN ('U'))
	DROP TABLE [dbo].[PostCity]
GO

CREATE TABLE [dbo].[PostCity] (
  [city] nvarchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL
)
GO

ALTER TABLE [dbo].[PostCity] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'縣市資料檔',
'SCHEMA', N'dbo',
'TABLE', N'PostCity'
GO


-- ----------------------------
-- Records of PostCity
-- ----------------------------
BEGIN TRANSACTION
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'台中市')
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'台北市')
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'台東縣')
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'台南市')
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'宜蘭縣')
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'花蓮縣')
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'金門縣')
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'南投縣')
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'南海諸島')
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'屏東縣')
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'苗栗縣')
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'桃園市')
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'高雄市')
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'基隆市')
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'連江縣')
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'雲林縣')
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'新北市')
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'新竹市')
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'新竹縣')
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'嘉義市')
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'嘉義縣')
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'彰化縣')
GO

INSERT INTO [dbo].[PostCity] ([city]) VALUES (N'澎湖縣')
GO

COMMIT
GO


-- ----------------------------
-- Table structure for PostNumber
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[PostNumber]') AND type IN ('U'))
	DROP TABLE [dbo].[PostNumber]
GO

CREATE TABLE [dbo].[PostNumber] (
  [ID] int  NOT NULL,
  [PostNumber] nvarchar(255) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [City] nvarchar(255) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [Area] nvarchar(255) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[PostNumber] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'縣市-郵遞區號檔',
'SCHEMA', N'dbo',
'TABLE', N'PostNumber'
GO


-- ----------------------------
-- Records of PostNumber
-- ----------------------------
BEGIN TRANSACTION
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'15', N'10001', N'台北市', N'中正區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'475', N'10341', N'台北市', N'大同區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'777', N'10401', N'台北市', N'中山區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'1346', N'10502', N'台北市', N'松山區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'2133', N'10601', N'台北市', N'大安區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'2263', N'10801', N'台北市', N'萬華區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'2644', N'11001', N'台北市', N'信義區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'2999', N'11101', N'台北市', N'士林區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'3571', N'11201', N'台北市', N'北投區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'3592', N'11441', N'台北市', N'內湖區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'3764', N'11501', N'台北市', N'南港區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'4053', N'11601', N'台北市', N'文山區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'4126', N'20001', N'基隆市', N'仁愛區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'4193', N'20101', N'基隆市', N'信義區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'4247', N'20201', N'基隆市', N'中正區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'4286', N'20301', N'基隆市', N'中山區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'4314', N'20401', N'基隆市', N'安樂區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'4320', N'20541', N'基隆市', N'暖暖區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'4337', N'20641', N'基隆市', N'七堵區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'4423', N'20741', N'新北市', N'萬里區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'4501', N'20841', N'新北市', N'金山區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'4580', N'20941', N'連江縣', N'南竿鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'4590', N'21041', N'連江縣', N'北竿鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'4599', N'21141', N'連江縣', N'莒光鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'4603', N'21241', N'連江縣', N'東引鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'4645', N'22001', N'新北市', N'板橋區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'5098', N'22101', N'新北市', N'汐止區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'5178', N'22201', N'新北市', N'深坑區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'5277', N'22301', N'新北市', N'石碇區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'5318', N'22441', N'新北市', N'瑞芳區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'5424', N'22641', N'新北市', N'平溪區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'5466', N'22741', N'新北市', N'雙溪區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'5556', N'22841', N'新北市', N'貢寮區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'5601', N'23141', N'新北市', N'新店區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'5982', N'23241', N'新北市', N'坪林區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'6035', N'23341', N'新北市', N'烏來區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'6086', N'23441', N'新北市', N'永和區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'6574', N'23501', N'新北市', N'中和區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'6813', N'23641', N'新北市', N'土城區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'6930', N'23701', N'新北市', N'三峽區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'7039', N'23806', N'新北市', N'樹林區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'7155', N'23941', N'新北市', N'鶯歌區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'7441', N'24101', N'新北市', N'三重區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'8101', N'24201', N'新北市', N'新莊區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'8493', N'24301', N'新北市', N'泰山區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'8668', N'24441', N'新北市', N'林口區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'8751', N'24701', N'新北市', N'蘆洲區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'8847', N'24801', N'新北市', N'五股區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'9027', N'24931', N'新北市', N'八里區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'9246', N'25103', N'新北市', N'淡水區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'9344', N'25241', N'新北市', N'三芝區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'9431', N'25341', N'新北市', N'石門區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'9477', N'26041', N'宜蘭縣', N'宜蘭市')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'9680', N'26141', N'宜蘭縣', N'頭城鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'9803', N'26241', N'宜蘭縣', N'礁溪鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'9898', N'26341', N'宜蘭縣', N'壯圍鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'9941', N'26441', N'宜蘭縣', N'員山鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'10083', N'26541', N'宜蘭縣', N'羅東鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'10257', N'26641', N'宜蘭縣', N'三星鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'10324', N'26741', N'宜蘭縣', N'大同鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'10412', N'26841', N'宜蘭縣', N'五結鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'10652', N'26941', N'宜蘭縣', N'冬山鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'10915', N'27041', N'宜蘭縣', N'蘇澳鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'11160', N'27241', N'宜蘭縣', N'南澳鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'11182', N'30046', N'新竹市', N'北區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'11183', N'30051', N'新竹市', N'東區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'11184', N'30046', N'新竹市', N'香山區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'11981', N'30210', N'新竹縣', N'竹北市')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'12329', N'30301', N'新竹縣', N'湖口鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'12714', N'30401', N'新竹縣', N'新豐鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'12753', N'30541', N'新竹縣', N'新埔鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'12893', N'30641', N'新竹縣', N'關西鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'13032', N'30740', N'新竹縣', N'芎林鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'13095', N'30841', N'新竹縣', N'寶山鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'13193', N'31040', N'新竹縣', N'竹東鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'13341', N'31141', N'新竹縣', N'五峰鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'13365', N'31241', N'新竹縣', N'橫山鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'13422', N'31341', N'新竹縣', N'尖石鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'13482', N'31441', N'新竹縣', N'北埔鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'13522', N'31541', N'新竹縣', N'峨眉鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'13776', N'32001', N'桃園市', N'中壢區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'14734', N'32441', N'桃園市', N'平鎮區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'15270', N'32541', N'桃園市', N'龍潭區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'15683', N'32601', N'桃園市', N'楊梅區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'15990', N'32741', N'桃園市', N'新屋區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'16113', N'32841', N'桃園市', N'觀音區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'16973', N'33001', N'桃園市', N'桃園區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'17121', N'33301', N'桃園市', N'龜山區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'17506', N'33441', N'桃園市', N'八德區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'17895', N'33509', N'桃園市', N'大溪區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'18118', N'33641', N'桃園市', N'復興區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'18192', N'33741', N'桃園市', N'大園區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'18692', N'33801', N'桃園市', N'蘆竹區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'18807', N'35041', N'苗栗縣', N'竹南鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'19139', N'35141', N'苗栗縣', N'頭份鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'19408', N'35241', N'苗栗縣', N'三灣鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'19476', N'35341', N'苗栗縣', N'南庄鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'19535', N'35441', N'苗栗縣', N'獅潭鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'19577', N'35641', N'苗栗縣', N'後龍鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'19738', N'35741', N'苗栗縣', N'通霄鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'19837', N'35841', N'苗栗縣', N'苑裡鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'20326', N'36001', N'苗栗縣', N'苗栗市')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'20350', N'36141', N'苗栗縣', N'造橋鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'20428', N'36241', N'苗栗縣', N'頭屋鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'20493', N'36341', N'苗栗縣', N'公館鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'20599', N'36441', N'苗栗縣', N'大湖鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'20676', N'36541', N'苗栗縣', N'泰安鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'20704', N'36641', N'苗栗縣', N'銅鑼鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'20818', N'36741', N'苗栗縣', N'三義鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'20863', N'36841', N'苗栗縣', N'西湖鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'20919', N'36941', N'苗栗縣', N'卓蘭鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'21035', N'40001', N'台中市', N'中區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'21118', N'40141', N'台中市', N'東區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'21414', N'40201', N'台中市', N'南區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'21714', N'40301', N'台中市', N'西區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'21940', N'40401', N'台中市', N'北區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'22970', N'40601', N'台中市', N'北屯區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'23315', N'40704', N'台中市', N'西屯區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'23786', N'40841', N'台中市', N'南屯區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'24360', N'41101', N'台中市', N'太平區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'24862', N'41200', N'台中市', N'大里區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'25057', N'41341', N'台中市', N'霧峰區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'25249', N'41400', N'台中市', N'烏日區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'25590', N'42007', N'台中市', N'豐原區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'25696', N'42141', N'台中市', N'后里區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'25813', N'42241', N'台中市', N'石岡區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'25892', N'42341', N'台中市', N'東勢區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'26097', N'42441', N'台中市', N'和平區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'26145', N'42641', N'台中市', N'新社區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'26249', N'42701', N'台中市', N'潭子區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'26517', N'42800', N'台中市', N'大雅區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'26582', N'42941', N'台中市', N'神岡區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'26830', N'43214', N'台中市', N'大肚區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'26887', N'43301', N'台中市', N'沙鹿區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'27274', N'43401', N'台中市', N'龍井區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'27342', N'43501', N'台中市', N'梧棲區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'27653', N'43641', N'台中市', N'清水區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'27818', N'43741', N'台中市', N'大甲區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'28139', N'43850', N'台中市', N'外埔區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'28149', N'43951', N'台中市', N'大安區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'28292', N'50001', N'彰化縣', N'彰化市')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'28791', N'50241', N'彰化縣', N'芬園鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'28885', N'50301', N'彰化縣', N'花壇鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'29016', N'50441', N'彰化縣', N'秀水鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'29181', N'50541', N'彰化縣', N'鹿港鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'29536', N'50641', N'彰化縣', N'福興鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'29610', N'50741', N'彰化縣', N'線西鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'29713', N'50841', N'彰化縣', N'和美鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'29982', N'50941', N'彰化縣', N'伸港鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'30177', N'51001', N'彰化縣', N'員林鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'30352', N'51141', N'彰化縣', N'社頭鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'30523', N'51241', N'彰化縣', N'永靖鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'30657', N'51341', N'彰化縣', N'埔心鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'30918', N'51441', N'彰化縣', N'溪湖鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'31198', N'51541', N'彰化縣', N'大村鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'31257', N'51641', N'彰化縣', N'埔鹽鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'31297', N'52041', N'彰化縣', N'田中鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'31465', N'52141', N'彰化縣', N'北斗鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'31601', N'52241', N'彰化縣', N'田尾鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'31718', N'52341', N'彰化縣', N'埤頭鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'31854', N'52441', N'彰化縣', N'溪州鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'32057', N'52541', N'彰化縣', N'竹塘鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'32154', N'52601', N'彰化縣', N'二林鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'32476', N'52742', N'彰化縣', N'大城鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'32573', N'52851', N'彰化縣', N'芳苑鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'32794', N'53041', N'彰化縣', N'二水鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'32944', N'54001', N'南投縣', N'南投市')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'33153', N'54151', N'南投縣', N'中寮鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'33182', N'54241', N'南投縣', N'草屯鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'33474', N'54441', N'南投縣', N'國姓鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'33530', N'54541', N'南投縣', N'埔里鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'33876', N'54641', N'南投縣', N'仁愛鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'33957', N'55141', N'南投縣', N'名間鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'34078', N'55241', N'南投縣', N'集集鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'34200', N'55341', N'南投縣', N'水里鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'34280', N'55541', N'南投縣', N'魚池鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'34334', N'55641', N'南投縣', N'信義鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'34486', N'55741', N'南投縣', N'竹山鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'34671', N'55841', N'南投縣', N'鹿谷鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'34818', N'60001', N'嘉義市', N'東區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'34819', N'60001', N'嘉義市', N'西區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'35518', N'60241', N'嘉義縣', N'番路鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'35634', N'60341', N'嘉義縣', N'梅山鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'35769', N'60441', N'嘉義縣', N'竹崎鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'35981', N'60541', N'嘉義縣', N'阿里山鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'36002', N'60641', N'嘉義縣', N'中埔鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'36186', N'60741', N'嘉義縣', N'大埔鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'36237', N'60841', N'嘉義縣', N'水上鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'36357', N'61141', N'嘉義縣', N'鹿草鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'36390', N'61241', N'嘉義縣', N'太保市')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'36531', N'61341', N'嘉義縣', N'朴子市')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'36713', N'61441', N'嘉義縣', N'東石鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'36784', N'61541', N'嘉義縣', N'六腳鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'36793', N'61641', N'嘉義縣', N'新港鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'36886', N'62102', N'嘉義縣', N'民雄鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'37088', N'62241', N'嘉義縣', N'大林鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'37227', N'62341', N'嘉義縣', N'溪口鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'37282', N'62441', N'嘉義縣', N'義竹鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'37312', N'62541', N'嘉義縣', N'布袋鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'37448', N'63041', N'雲林縣', N'斗南鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'37655', N'63141', N'雲林縣', N'大埤鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'37754', N'63201', N'雲林縣', N'虎尾鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'37910', N'63341', N'雲林縣', N'土庫鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'37979', N'63441', N'雲林縣', N'褒忠鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'38029', N'63541', N'雲林縣', N'東勢鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'38086', N'63641', N'雲林縣', N'台西鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'38134', N'63741', N'雲林縣', N'崙背鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'38214', N'63801', N'雲林縣', N'麥寮鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'38622', N'64001', N'雲林縣', N'斗六市')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'38719', N'64341', N'雲林縣', N'林內鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'38833', N'64641', N'雲林縣', N'古坑鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'38853', N'64741', N'雲林縣', N'莿桐鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'38904', N'64841', N'雲林縣', N'西螺鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'39023', N'64941', N'雲林縣', N'二崙鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'39105', N'65141', N'雲林縣', N'北港鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'39300', N'65241', N'雲林縣', N'水林鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'39360', N'65341', N'雲林縣', N'口湖鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'39459', N'65441', N'雲林縣', N'四湖鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'39540', N'65541', N'雲林縣', N'元長鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'39774', N'70002', N'台南市', N'中西區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'39906', N'70101', N'台南市', N'東區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'40282', N'70241', N'台南市', N'南區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'40471', N'70401', N'台南市', N'北區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'40603', N'70801', N'台南市', N'安平區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'40831', N'70941', N'台南市', N'安南區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'41211', N'71001', N'台南市', N'永康區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'41924', N'71101', N'台南市', N'歸仁區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'41969', N'71241', N'台南市', N'新化區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'42017', N'71341', N'台南市', N'左鎮區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'42032', N'71441', N'台南市', N'玉井區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'42100', N'71541', N'台南市', N'楠西區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'42142', N'71641', N'台南市', N'南化區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'42157', N'71702', N'台南市', N'仁德區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'42349', N'71841', N'台南市', N'關廟區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'42548', N'71941', N'台南市', N'龍崎區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'42609', N'72041', N'台南市', N'官田區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'42727', N'72141', N'台南市', N'麻豆區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'42853', N'72241', N'台南市', N'佳里區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'42929', N'72341', N'台南市', N'西港區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'42973', N'72441', N'台南市', N'七股區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'43030', N'72541', N'台南市', N'將軍區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'43056', N'72641', N'台南市', N'學甲區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'43140', N'72742', N'台南市', N'北門區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'43214', N'73001', N'台南市', N'新營區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'43373', N'73141', N'台南市', N'後壁區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'43428', N'73241', N'台南市', N'白河區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'43591', N'73343', N'台南市', N'東山區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'43670', N'73441', N'台南市', N'六甲區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'43765', N'73541', N'台南市', N'下營區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'43901', N'73656', N'台南市', N'柳營區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'44010', N'73741', N'台南市', N'鹽水區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'44127', N'74144', N'台南市', N'善化區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'44272', N'74242', N'台南市', N'大內區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'44302', N'74341', N'台南市', N'山上區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'44333', N'74441', N'台南市', N'新市區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'44418', N'74542', N'台南市', N'安定區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'44503', N'80002', N'高雄市', N'新興區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'44586', N'80122', N'高雄市', N'前金區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'44734', N'80201', N'高雄市', N'苓雅區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'44872', N'80341', N'高雄市', N'鹽埕區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'44967', N'80402', N'高雄市', N'鼓山區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'45089', N'80541', N'高雄市', N'旗津區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'45185', N'80603', N'高雄市', N'前鎮區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'45839', N'80706', N'高雄市', N'三民區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'46461', N'81126', N'高雄市', N'楠梓區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'46829', N'81233', N'高雄市', N'小港區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'47306', N'81341', N'高雄市', N'左營區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'47910', N'81442', N'高雄市', N'仁武區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'47931', N'81541', N'高雄市', N'大社區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'48063', N'81741', N'高雄市', N'旗津區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'48064', N'81941', N'南海諸島', N'南沙')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'48131', N'82041', N'高雄市', N'岡山區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'48379', N'82141', N'高雄市', N'路竹區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'48511', N'82241', N'高雄市', N'阿蓮區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'48568', N'82341', N'高雄市', N'田寮區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'48632', N'82441', N'高雄市', N'燕巢區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'48768', N'82541', N'高雄市', N'橋頭區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'49071', N'82641', N'高雄市', N'梓官區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'49175', N'82741', N'高雄市', N'彌陀區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'49244', N'82841', N'高雄市', N'永安區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'49284', N'82941', N'高雄市', N'湖內區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'49593', N'83001', N'高雄市', N'鳳山區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'50116', N'83101', N'高雄市', N'大寮區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'50377', N'83241', N'高雄市', N'林園區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'50546', N'83301', N'高雄市', N'鳥松區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'50828', N'84001', N'高雄市', N'大樹區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'50871', N'84241', N'高雄市', N'旗山區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'51085', N'84341', N'高雄市', N'美濃區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'51245', N'84441', N'高雄市', N'六龜區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'51332', N'84542', N'高雄市', N'內門區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'51382', N'84649', N'高雄市', N'杉林區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'51400', N'84741', N'高雄市', N'甲仙區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'51437', N'84841', N'高雄市', N'桃源區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'51449', N'84941', N'高雄市', N'三民區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'51461', N'85141', N'高雄市', N'茂林區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'51470', N'85241', N'高雄市', N'茄萣區')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'51567', N'88041', N'澎湖縣', N'馬公市')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'51769', N'88141', N'澎湖縣', N'西嶼鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'51788', N'88241', N'澎湖縣', N'望安鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'51801', N'88341', N'澎湖縣', N'七美鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'51833', N'88441', N'澎湖縣', N'白沙鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'51860', N'88541', N'澎湖縣', N'湖西鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'51914', N'89041', N'金門縣', N'金沙鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'51960', N'89141', N'金門縣', N'金湖鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'52030', N'89244', N'金門縣', N'金寧鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'52093', N'89344', N'金門縣', N'金城鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'52146', N'89441', N'金門縣', N'烈嶼鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'52172', N'89641', N'金門縣', N'烏坵鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'52513', N'90001', N'屏東縣', N'屏東市')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'53031', N'90141', N'屏東縣', N'三地門鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'53047', N'90241', N'屏東縣', N'霧台鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'53064', N'90341', N'屏東縣', N'瑪家鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'53074', N'90441', N'屏東縣', N'九如鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'53182', N'90541', N'屏東縣', N'里港鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'53266', N'90641', N'屏東縣', N'高樹鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'53382', N'90741', N'屏東縣', N'鹽埔鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'53512', N'90841', N'屏東縣', N'長治鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'53646', N'90941', N'屏東縣', N'麟洛鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'53724', N'91141', N'屏東縣', N'竹田鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'54083', N'91201', N'屏東縣', N'內埔鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'54132', N'91341', N'屏東縣', N'萬丹鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'54350', N'92041', N'屏東縣', N'潮州鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'54648', N'92141', N'屏東縣', N'泰武鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'54661', N'92241', N'屏東縣', N'來義鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'54671', N'92341', N'屏東縣', N'萬巒鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'54751', N'92441', N'屏東縣', N'崁頂鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'54788', N'92541', N'屏東縣', N'新埤鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'54835', N'92641', N'屏東縣', N'南州鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'54876', N'92741', N'屏東縣', N'林邊鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'54936', N'92841', N'屏東縣', N'東港鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'55059', N'92941', N'屏東縣', N'琉球鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'55092', N'93141', N'屏東縣', N'佳冬鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'55197', N'93241', N'屏東縣', N'新園鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'55316', N'94041', N'屏東縣', N'枋寮鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'55438', N'94145', N'屏東縣', N'枋山鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'55455', N'94248', N'屏東縣', N'春日鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'55464', N'94350', N'屏東縣', N'獅子鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'55479', N'94441', N'屏東縣', N'車城鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'55518', N'94541', N'屏東縣', N'牡丹鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'55580', N'94641', N'屏東縣', N'恆春鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'55647', N'94741', N'屏東縣', N'滿州鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'55719', N'95001', N'台東縣', N'台東市')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'56039', N'95141', N'台東縣', N'綠島鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'56045', N'95241', N'台東縣', N'蘭嶼鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'56055', N'95341', N'台東縣', N'延平鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'56071', N'95441', N'台東縣', N'卑南鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'56118', N'95541', N'台東縣', N'鹿野鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'56192', N'95641', N'台東縣', N'關山鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'56265', N'95741', N'台東縣', N'海端鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'56285', N'95841', N'台東縣', N'池上鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'56354', N'95941', N'台東縣', N'東河鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'56440', N'96141', N'台東縣', N'成功鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'56480', N'96241', N'台東縣', N'長濱鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'56518', N'96341', N'台東縣', N'太麻里鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'56536', N'96441', N'台東縣', N'金峰鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'56543', N'96541', N'台東縣', N'大武鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'56587', N'96692', N'台東縣', N'達仁鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'56763', N'97001', N'花蓮縣', N'花蓮市')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'57136', N'97141', N'花蓮縣', N'新城鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'57164', N'97241', N'花蓮縣', N'秀林鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'57500', N'97341', N'花蓮縣', N'吉安鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'57669', N'97401', N'花蓮縣', N'壽豐鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'57816', N'97541', N'花蓮縣', N'鳳林鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'57951', N'97641', N'花蓮縣', N'光復鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'58048', N'97791', N'花蓮縣', N'豐濱鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'58085', N'97841', N'花蓮縣', N'瑞穗鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'58141', N'97942', N'花蓮縣', N'萬榮鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'58155', N'98141', N'花蓮縣', N'玉里鎮')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'58310', N'98241', N'花蓮縣', N'卓溪鄉')
GO

INSERT INTO [dbo].[PostNumber] ([ID], [PostNumber], [City], [Area]) VALUES (N'58321', N'98341', N'花蓮縣', N'富里鄉')
GO

COMMIT
GO


-- ----------------------------
-- Table structure for pro_order
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[pro_order]') AND type IN ('U'))
	DROP TABLE [dbo].[pro_order]
GO

CREATE TABLE [dbo].[pro_order] (
  [order_no] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [up_time] datetime  NULL,
  [reg_time] datetime DEFAULT getdate() NULL,
  [keyin1] nvarchar(3) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [f_num] int  NULL,
  [phone] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [activity_num] int  NULL,
  [address] nvarchar(200) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [customize_data] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [introducer] int  NULL,
  [send_receipt] bit  NULL,
  [receipt_title] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[pro_order] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'報名主檔',
'SCHEMA', N'dbo',
'TABLE', N'pro_order'
GO


-- ----------------------------
-- Records of pro_order
-- ----------------------------
BEGIN TRANSACTION
GO

COMMIT
GO


-- ----------------------------
-- Table structure for pro_order_detail
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[pro_order_detail]') AND type IN ('U'))
	DROP TABLE [dbo].[pro_order_detail]
GO

CREATE TABLE [dbo].[pro_order_detail] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [order_no] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [actItem_num] int  NULL,
  [parent_num] int  NULL,
  [print_id] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [f_num] int  NULL,
  [f_num_tablet] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [address] nvarchar(200) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [from_id] int  NULL,
  [from_id_tablet] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [due_date] datetime  NULL,
  [bed_type] int  NULL,
  [price] real  NULL,
  [qty] int  NULL,
  [start_date] datetime  NULL,
  [extend_date] datetime  NULL,
  [pay] real  NULL,
  [pay_date] datetime  NULL,
  [keyin1] int  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [customize_data] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [printed_files] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [UpdateTime] datetime2(7)  NULL
)
GO

ALTER TABLE [dbo].[pro_order_detail] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'報名明細檔',
'SCHEMA', N'dbo',
'TABLE', N'pro_order_detail'
GO


-- ----------------------------
-- Records of pro_order_detail
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[pro_order_detail] ON
GO

SET IDENTITY_INSERT [dbo].[pro_order_detail] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for pro_order_record
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[pro_order_record]') AND type IN ('U'))
	DROP TABLE [dbo].[pro_order_record]
GO

CREATE TABLE [dbo].[pro_order_record] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [detail_num] int  NULL,
  [price] real  NULL,
  [payment] int  NULL,
  [reg_time] datetime DEFAULT getdate() NULL,
  [pay_date] datetime  NULL,
  [organization] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [bank_code] nvarchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [transfer_id] int  NULL,
  [reconcile_memo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[pro_order_record] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'(新1)報名收款記錄',
'SCHEMA', N'dbo',
'TABLE', N'pro_order_record'
GO


-- ----------------------------
-- Records of pro_order_record
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[pro_order_record] ON
GO

SET IDENTITY_INSERT [dbo].[pro_order_record] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for project
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[project]') AND type IN ('U'))
	DROP TABLE [dbo].[project]
GO

CREATE TABLE [dbo].[project] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [subject] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [kind] int  NULL,
  [actItem_num] int  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [reg_time] datetime DEFAULT getdate() NULL
)
GO

ALTER TABLE [dbo].[project] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'專案管理',
'SCHEMA', N'dbo',
'TABLE', N'project'
GO


-- ----------------------------
-- Records of project
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[project] ON
GO

SET IDENTITY_INSERT [dbo].[project] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for project_kind
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[project_kind]') AND type IN ('U'))
	DROP TABLE [dbo].[project_kind]
GO

CREATE TABLE [dbo].[project_kind] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [kind] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [root] int DEFAULT 0 NULL,
  [range] int  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[project_kind] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'專案類別管理',
'SCHEMA', N'dbo',
'TABLE', N'project_kind'
GO


-- ----------------------------
-- Records of project_kind
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[project_kind] ON
GO

SET IDENTITY_INSERT [dbo].[project_kind] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for project_sub
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[project_sub]') AND type IN ('U'))
	DROP TABLE [dbo].[project_sub]
GO

CREATE TABLE [dbo].[project_sub] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [subject] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [uptime] datetime DEFAULT CONVERT([varchar],getdate(),(111)) NULL,
  [reg_time] datetime DEFAULT getdate() NULL,
  [word] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [pic1] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [pro_id] int  NULL
)
GO

ALTER TABLE [dbo].[project_sub] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'專案管理-活動資料',
'SCHEMA', N'dbo',
'TABLE', N'project_sub'
GO


-- ----------------------------
-- Records of project_sub
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[project_sub] ON
GO

SET IDENTITY_INSERT [dbo].[project_sub] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for Region
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Region]') AND type IN ('U'))
	DROP TABLE [dbo].[Region]
GO

CREATE TABLE [dbo].[Region] (
  [Name] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [Description] nvarchar(200) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [SortOrder] int DEFAULT 0 NULL,
  [CreatedBy] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [CreatedAt] datetime  NULL,
  [UpdatedAt] datetime  NULL,
  [IsActive] bit DEFAULT 1 NOT NULL,
  [RoomCount] int  NULL,
  [IsDeleted] bit DEFAULT 0 NOT NULL,
  [Uuid] uniqueidentifier  NOT NULL,
  [ParentUuid] uniqueidentifier  NULL,
  [RegionTypeUuid] uniqueidentifier  NULL,
  [Gender] bit  NULL
)
GO

ALTER TABLE [dbo].[Region] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of Region
-- ----------------------------
BEGIN TRANSACTION
GO

COMMIT
GO


-- ----------------------------
-- Table structure for RegionAndRoomAndBedSchedule
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[RegionAndRoomAndBedSchedule]') AND type IN ('U'))
	DROP TABLE [dbo].[RegionAndRoomAndBedSchedule]
GO

CREATE TABLE [dbo].[RegionAndRoomAndBedSchedule] (
  [UseType] int  NOT NULL,
  [Title] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [Description] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [CreatedBy] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [CreatedAt] datetime2(7)  NULL,
  [IsDeleted] bit DEFAULT 0 NOT NULL,
  [Uuid] uniqueidentifier DEFAULT newid() NOT NULL,
  [TargetUuid] uniqueidentifier  NULL,
  [GuaDanOrderNo] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [ScheduleDate] date  NULL,
  [IsCancel] bit DEFAULT 0 NOT NULL,
  [GuaDanOrderGuestUuid] uniqueidentifier  NULL
)
GO

ALTER TABLE [dbo].[RegionAndRoomAndBedSchedule] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of RegionAndRoomAndBedSchedule
-- ----------------------------
BEGIN TRANSACTION
GO

COMMIT
GO


-- ----------------------------
-- Table structure for RegionRoomBed
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[RegionRoomBed]') AND type IN ('U'))
	DROP TABLE [dbo].[RegionRoomBed]
GO

CREATE TABLE [dbo].[RegionRoomBed] (
  [Name] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [IsActive] bit DEFAULT 1 NOT NULL,
  [Gender] bit DEFAULT 1 NOT NULL,
  [IsDeleted] bit DEFAULT 0 NOT NULL,
  [Uuid] uniqueidentifier DEFAULT newid() NOT NULL,
  [RoomUuid] uniqueidentifier  NOT NULL,
  [StatusCode] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL
)
GO

ALTER TABLE [dbo].[RegionRoomBed] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of RegionRoomBed
-- ----------------------------
BEGIN TRANSACTION
GO

COMMIT
GO


-- ----------------------------
-- Table structure for RegionRoomBedStatus
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[RegionRoomBedStatus]') AND type IN ('U'))
	DROP TABLE [dbo].[RegionRoomBedStatus]
GO

CREATE TABLE [dbo].[RegionRoomBedStatus] (
  [Code] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [Name] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [Description] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [Category] int  NULL,
  [IsDeleted] bit DEFAULT 0 NOT NULL
)
GO

ALTER TABLE [dbo].[RegionRoomBedStatus] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of RegionRoomBedStatus
-- ----------------------------
BEGIN TRANSACTION
GO

INSERT INTO [dbo].[RegionRoomBedStatus] ([Code], [Name], [Description], [Category], [IsDeleted]) VALUES (N'101', N'空床', N'床位可分配', N'1', N'0')
GO

INSERT INTO [dbo].[RegionRoomBedStatus] ([Code], [Name], [Description], [Category], [IsDeleted]) VALUES (N'102', N'占用中', N'床位已有人使用', N'1', N'0')
GO

INSERT INTO [dbo].[RegionRoomBedStatus] ([Code], [Name], [Description], [Category], [IsDeleted]) VALUES (N'103', N'維修停用', N'床位維修或不可使用', N'1', N'0')
GO

INSERT INTO [dbo].[RegionRoomBedStatus] ([Code], [Name], [Description], [Category], [IsDeleted]) VALUES (N'301', N'空房', N'房間所有床位皆為空', N'3', N'0')
GO

INSERT INTO [dbo].[RegionRoomBedStatus] ([Code], [Name], [Description], [Category], [IsDeleted]) VALUES (N'302', N'部分入住', N'房間有人，但仍有空床', N'3', N'0')
GO

INSERT INTO [dbo].[RegionRoomBedStatus] ([Code], [Name], [Description], [Category], [IsDeleted]) VALUES (N'303', N'已滿', N'房間所有床位皆已入住', N'3', N'0')
GO

INSERT INTO [dbo].[RegionRoomBedStatus] ([Code], [Name], [Description], [Category], [IsDeleted]) VALUES (N'304', N'維修停用', N'房間維修或不可使用', N'3', N'0')
GO

INSERT INTO [dbo].[RegionRoomBedStatus] ([Code], [Name], [Description], [Category], [IsDeleted]) VALUES (N'401', N'預訂成功', N'默認就是預訂成功狀態', N'4', N'0')
GO

INSERT INTO [dbo].[RegionRoomBedStatus] ([Code], [Name], [Description], [Category], [IsDeleted]) VALUES (N'402', N'已入住', N'已辦理入住', N'4', N'0')
GO

INSERT INTO [dbo].[RegionRoomBedStatus] ([Code], [Name], [Description], [Category], [IsDeleted]) VALUES (N'403', N'已退房', N'', N'4', N'0')
GO

INSERT INTO [dbo].[RegionRoomBedStatus] ([Code], [Name], [Description], [Category], [IsDeleted]) VALUES (N'404', N'已取消', N'取消後的狀態，不是取消的動作', N'4', N'0')
GO

COMMIT
GO


-- ----------------------------
-- Table structure for RegionType
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[RegionType]') AND type IN ('U'))
	DROP TABLE [dbo].[RegionType]
GO

CREATE TABLE [dbo].[RegionType] (
  [Code] varchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [Name] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [IsActive] bit DEFAULT 1 NOT NULL,
  [CreateAt] datetime  NULL,
  [IsDeleted] bit DEFAULT 0 NOT NULL,
  [Uuid] uniqueidentifier DEFAULT newid() NOT NULL
)
GO

ALTER TABLE [dbo].[RegionType] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of RegionType
-- ----------------------------
BEGIN TRANSACTION
GO

INSERT INTO [dbo].[RegionType] ([Code], [Name], [IsActive], [CreateAt], [IsDeleted], [Uuid]) VALUES (N'room', N'客房', N'1', NULL, N'0', N'A0B583E1-4189-47DD-A836-46217577EBAA')
GO

INSERT INTO [dbo].[RegionType] ([Code], [Name], [IsActive], [CreateAt], [IsDeleted], [Uuid]) VALUES (N'floor', N'樓層', N'1', NULL, N'0', N'CF12FC3C-0E37-4032-B3B8-DEA728666531')
GO

COMMIT
GO


-- ----------------------------
-- Table structure for Room
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Room]') AND type IN ('U'))
	DROP TABLE [dbo].[Room]
GO

CREATE TABLE [dbo].[Room] (
  [Name] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [Gender] bit  NOT NULL,
  [BedCount] int  NULL,
  [IsActive] bit DEFAULT 1 NULL,
  [CreatedAt] datetime DEFAULT NULL NULL,
  [UpdatedAt] datetime  NULL,
  [IsDeleted] bit DEFAULT 0 NOT NULL,
  [Uuid] uniqueidentifier DEFAULT newid() NOT NULL,
  [RegionUuid] uniqueidentifier  NOT NULL
)
GO

ALTER TABLE [dbo].[Room] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Records of Room
-- ----------------------------
BEGIN TRANSACTION
GO

COMMIT
GO


-- ----------------------------
-- Table structure for ShuWen
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[ShuWen]') AND type IN ('U'))
	DROP TABLE [dbo].[ShuWen]
GO

CREATE TABLE [dbo].[ShuWen] (
  [ID] int  IDENTITY(1,1) NOT NULL,
  [ActivityNum] int  NOT NULL,
  [CreateTime] datetime2(7)  NOT NULL,
  [UpdateTime] datetime2(7)  NOT NULL,
  [ShuWenList] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [IsGenerating] bit DEFAULT 0 NOT NULL
)
GO

ALTER TABLE [dbo].[ShuWen] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'疏文資料表',
'SCHEMA', N'dbo',
'TABLE', N'ShuWen'
GO


-- ----------------------------
-- Records of ShuWen
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[ShuWen] ON
GO

SET IDENTITY_INSERT [dbo].[ShuWen] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for stock
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[stock]') AND type IN ('U'))
	DROP TABLE [dbo].[stock]
GO

CREATE TABLE [dbo].[stock] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [uptime] datetime DEFAULT CONVERT([varchar],getdate(),(111)) NULL,
  [category] int  NULL,
  [kind] int  NULL,
  [activity_num] int  NULL,
  [actItem_num] int  NULL,
  [qty] int  NULL,
  [price] real  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [reg_time] datetime DEFAULT getdate() NULL,
  [mem_num] int  NULL,
  [debtor] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [balances] int  NULL,
  [reason] int  NULL,
  [supplier] int  NULL,
  [final_stock] int  NULL,
  [rent_stock] int  NULL
)
GO

ALTER TABLE [dbo].[stock] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'庫存管理主檔',
'SCHEMA', N'dbo',
'TABLE', N'stock'
GO


-- ----------------------------
-- Records of stock
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[stock] ON
GO

SET IDENTITY_INSERT [dbo].[stock] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for stock_files
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[stock_files]') AND type IN ('U'))
	DROP TABLE [dbo].[stock_files]
GO

CREATE TABLE [dbo].[stock_files] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [stock_num] int  NULL,
  [reg_time] datetime DEFAULT getdate() NULL,
  [pic1] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [pic1_name] nvarchar(150) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[stock_files] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'庫存管理-檔案附件',
'SCHEMA', N'dbo',
'TABLE', N'stock_files'
GO


-- ----------------------------
-- Records of stock_files
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[stock_files] ON
GO

SET IDENTITY_INSERT [dbo].[stock_files] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for stock_kind
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[stock_kind]') AND type IN ('U'))
	DROP TABLE [dbo].[stock_kind]
GO

CREATE TABLE [dbo].[stock_kind] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [kind] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [root] int DEFAULT 0 NULL,
  [range] int  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[stock_kind] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'倉庫資料主檔',
'SCHEMA', N'dbo',
'TABLE', N'stock_kind'
GO


-- ----------------------------
-- Records of stock_kind
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[stock_kind] ON
GO

SET IDENTITY_INSERT [dbo].[stock_kind] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for stock_reason
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[stock_reason]') AND type IN ('U'))
	DROP TABLE [dbo].[stock_reason]
GO

CREATE TABLE [dbo].[stock_reason] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [kind] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [root] int DEFAULT 0 NULL,
  [range] int  NULL,
  [category] int  NULL
)
GO

ALTER TABLE [dbo].[stock_reason] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'庫存異動原因',
'SCHEMA', N'dbo',
'TABLE', N'stock_reason'
GO


-- ----------------------------
-- Records of stock_reason
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[stock_reason] ON
GO

INSERT INTO [dbo].[stock_reason] ([num], [kind], [root], [range], [category]) VALUES (N'1', N'進貨', N'0', N'1', N'1')
GO

INSERT INTO [dbo].[stock_reason] ([num], [kind], [root], [range], [category]) VALUES (N'2', N'遺失', N'0', N'2', N'2')
GO

INSERT INTO [dbo].[stock_reason] ([num], [kind], [root], [range], [category]) VALUES (N'3', N'捐贈', N'0', N'3', N'1')
GO

SET IDENTITY_INSERT [dbo].[stock_reason] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for supplier
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[supplier]') AND type IN ('U'))
	DROP TABLE [dbo].[supplier]
GO

CREATE TABLE [dbo].[supplier] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [s_number] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [u_name] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [kind] int  NULL,
  [phone2] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [phone1] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [address] nvarchar(200) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [fax] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [email] nvarchar(200) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [url] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [pic1] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [reg_time] datetime DEFAULT getdate() NULL,
  [admin_log] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [c_num] nvarchar(8) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[supplier] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'(新3)供應商主檔',
'SCHEMA', N'dbo',
'TABLE', N'supplier'
GO


-- ----------------------------
-- Records of supplier
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[supplier] ON
GO

SET IDENTITY_INSERT [dbo].[supplier] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for supplier_kind
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[supplier_kind]') AND type IN ('U'))
	DROP TABLE [dbo].[supplier_kind]
GO

CREATE TABLE [dbo].[supplier_kind] (
  [num] int  IDENTITY(1,1) NOT NULL,
  [kind] nvarchar(100) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [root] int DEFAULT 0 NULL,
  [range] int  NULL,
  [demo] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[supplier_kind] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'供應商類型',
'SCHEMA', N'dbo',
'TABLE', N'supplier_kind'
GO


-- ----------------------------
-- Records of supplier_kind
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[supplier_kind] ON
GO

SET IDENTITY_INSERT [dbo].[supplier_kind] OFF
GO

COMMIT
GO


-- ----------------------------
-- Table structure for TabletElement
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[TabletElement]') AND type IN ('U'))
	DROP TABLE [dbo].[TabletElement]
GO

CREATE TABLE [dbo].[TabletElement] (
  [ElementID] varchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [Name] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NOT NULL,
  [ElementType] varchar(30) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NOT NULL,
  [CUser] varchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [CDate] varchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [CTime] varchar(6) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [UUser] varchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [UDate] varchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [UTime] varchar(6) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [SampleContent] nvarchar(200) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL
)
GO

ALTER TABLE [dbo].[TabletElement] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'牌位的元素',
'SCHEMA', N'dbo',
'TABLE', N'TabletElement'
GO


-- ----------------------------
-- Records of TabletElement
-- ----------------------------
BEGIN TRANSACTION
GO

INSERT INTO [dbo].[TabletElement] ([ElementID], [Name], [ElementType], [CUser], [CDate], [CTime], [UUser], [UDate], [UTime], [SampleContent]) VALUES (N'address', N'地址', N'address', N'', N'', N'', N'', N'', N'', N'台中市潭子區')
GO

INSERT INTO [dbo].[TabletElement] ([ElementID], [Name], [ElementType], [CUser], [CDate], [CTime], [UUser], [UDate], [UTime], [SampleContent]) VALUES (N'alive', N'陽上', N'alive', N'', N'', N'', N'', N'', N'', N' 姓名')
GO

INSERT INTO [dbo].[TabletElement] ([ElementID], [Name], [ElementType], [CUser], [CDate], [CTime], [UUser], [UDate], [UTime], [SampleContent]) VALUES (N'combined', N'雙姓合併', N'combined-center', N'', N'', N'', N'', N'', N'', N'林李\n門中歷代祖先')
GO

INSERT INTO [dbo].[TabletElement] ([ElementID], [Name], [ElementType], [CUser], [CDate], [CTime], [UUser], [UDate], [UTime], [SampleContent]) VALUES (N'lefttitle', N'左正名', N'ancestor', N'', N'', N'', N'', N'', N'', N'左正名')
GO

INSERT INTO [dbo].[TabletElement] ([ElementID], [Name], [ElementType], [CUser], [CDate], [CTime], [UUser], [UDate], [UTime], [SampleContent]) VALUES (N'rigthtitle', N'右正名', N'ancestor', N'', N'', N'', N'', N'', N'', N'右正名')
GO

INSERT INTO [dbo].[TabletElement] ([ElementID], [Name], [ElementType], [CUser], [CDate], [CTime], [UUser], [UDate], [UTime], [SampleContent]) VALUES (N'title1', N'牌位正名', N'ancestor', N'', N'', N'', N'', N'', N'', N'累劫冤親債主')
GO

INSERT INTO [dbo].[TabletElement] ([ElementID], [Name], [ElementType], [CUser], [CDate], [CTime], [UUser], [UDate], [UTime], [SampleContent]) VALUES (N'titletriangle', N'品字名單', N'roster', N'', N'', N'', N'', N'', N'', N'張一\n李二\n陳三\n王四\n劉五\n趙六\n吳七\n鄭八')
GO

INSERT INTO [dbo].[TabletElement] ([ElementID], [Name], [ElementType], [CUser], [CDate], [CTime], [UUser], [UDate], [UTime], [SampleContent]) VALUES (N'tricombined', N'三姓合併', N'combined-center', N'', N'', N'', N'', N'', N'', N'林張李\n門中歷代祖先')
GO

COMMIT
GO


-- ----------------------------
-- Table structure for TabletStyle
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[TabletStyle]') AND type IN ('U'))
	DROP TABLE [dbo].[TabletStyle]
GO

CREATE TABLE [dbo].[TabletStyle] (
  [StyleID] varchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [Name] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [Descr] nvarchar(255) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [PaperSize] varchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [BackendImg] varchar(255) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [PrintSize] varchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [PrintMode] varchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [Orientation] varchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [PrintPageCount] varchar(5) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [CUser] varchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [CDate] varchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [CTime] varchar(6) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [UUser] varchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [UDate] varchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [UTime] varchar(6) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL
)
GO

ALTER TABLE [dbo].[TabletStyle] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'名稱',
'SCHEMA', N'dbo',
'TABLE', N'TabletStyle',
'COLUMN', N'Name'
GO

EXEC sp_addextendedproperty
'MS_Description', N'說明',
'SCHEMA', N'dbo',
'TABLE', N'TabletStyle',
'COLUMN', N'Descr'
GO

EXEC sp_addextendedproperty
'MS_Description', N'紙張尺寸',
'SCHEMA', N'dbo',
'TABLE', N'TabletStyle',
'COLUMN', N'PaperSize'
GO

EXEC sp_addextendedproperty
'MS_Description', N'背景圖',
'SCHEMA', N'dbo',
'TABLE', N'TabletStyle',
'COLUMN', N'BackendImg'
GO

EXEC sp_addextendedproperty
'MS_Description', N'列印尺寸',
'SCHEMA', N'dbo',
'TABLE', N'TabletStyle',
'COLUMN', N'PrintSize'
GO

EXEC sp_addextendedproperty
'MS_Description', N'列印模式：combine以原尺寸合併列印尺寸，origin：原尺寸列印',
'SCHEMA', N'dbo',
'TABLE', N'TabletStyle',
'COLUMN', N'PrintMode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'方向',
'SCHEMA', N'dbo',
'TABLE', N'TabletStyle',
'COLUMN', N'Orientation'
GO

EXEC sp_addextendedproperty
'MS_Description', N'每頁列印數，配合PrintMode',
'SCHEMA', N'dbo',
'TABLE', N'TabletStyle',
'COLUMN', N'PrintPageCount'
GO


-- ----------------------------
-- Records of TabletStyle
-- ----------------------------
BEGIN TRANSACTION
GO

INSERT INTO [dbo].[TabletStyle] ([StyleID], [Name], [Descr], [PaperSize], [BackendImg], [PrintSize], [PrintMode], [Orientation], [PrintPageCount], [CUser], [CDate], [CTime], [UUser], [UDate], [UTime]) VALUES (N'20260305170349', N'超薦一般', N'', N'red', N'黃1', N'red', N'origin', N'', N'1', N'', N'', N'', N'', N'', N'')
GO

COMMIT
GO


-- ----------------------------
-- Table structure for TabletStyleDetail
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[TabletStyleDetail]') AND type IN ('U'))
	DROP TABLE [dbo].[TabletStyleDetail]
GO

CREATE TABLE [dbo].[TabletStyleDetail] (
  [StyleID] varchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NOT NULL,
  [Name] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [Descr] nvarchar(255) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [ElementID] varchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NOT NULL,
  [StartX] varchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [StartY] varchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [FontSize] varchar(5) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [BreakLen] varchar(5) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [FontFamily] varchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [TwoOffset] varchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [ThreeOffset] varchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [FourOffset] varchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [IsActive] varchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [CUser] varchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [CDate] varchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [CTime] varchar(6) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [UUser] varchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [UDate] varchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [UTime] varchar(6) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL,
  [Width] varchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS DEFAULT '' NULL
)
GO

ALTER TABLE [dbo].[TabletStyleDetail] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'說明',
'SCHEMA', N'dbo',
'TABLE', N'TabletStyleDetail',
'COLUMN', N'Descr'
GO

EXEC sp_addextendedproperty
'MS_Description', N'元素',
'SCHEMA', N'dbo',
'TABLE', N'TabletStyleDetail',
'COLUMN', N'ElementID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'X軸位置',
'SCHEMA', N'dbo',
'TABLE', N'TabletStyleDetail',
'COLUMN', N'StartX'
GO

EXEC sp_addextendedproperty
'MS_Description', N'Y軸位置',
'SCHEMA', N'dbo',
'TABLE', N'TabletStyleDetail',
'COLUMN', N'StartY'
GO

EXEC sp_addextendedproperty
'MS_Description', N'字型大小',
'SCHEMA', N'dbo',
'TABLE', N'TabletStyleDetail',
'COLUMN', N'FontSize'
GO

EXEC sp_addextendedproperty
'MS_Description', N'多少字斷行',
'SCHEMA', N'dbo',
'TABLE', N'TabletStyleDetail',
'COLUMN', N'BreakLen'
GO

EXEC sp_addextendedproperty
'MS_Description', N'字型',
'SCHEMA', N'dbo',
'TABLE', N'TabletStyleDetail',
'COLUMN', N'FontFamily'
GO

EXEC sp_addextendedproperty
'MS_Description', N'兩行字偏移',
'SCHEMA', N'dbo',
'TABLE', N'TabletStyleDetail',
'COLUMN', N'TwoOffset'
GO

EXEC sp_addextendedproperty
'MS_Description', N'三行字偏移',
'SCHEMA', N'dbo',
'TABLE', N'TabletStyleDetail',
'COLUMN', N'ThreeOffset'
GO

EXEC sp_addextendedproperty
'MS_Description', N'四行字偏移',
'SCHEMA', N'dbo',
'TABLE', N'TabletStyleDetail',
'COLUMN', N'FourOffset'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否使用',
'SCHEMA', N'dbo',
'TABLE', N'TabletStyleDetail',
'COLUMN', N'IsActive'
GO

EXEC sp_addextendedproperty
'MS_Description', N'寬度，品字要固定才不會因為行數少了而位移',
'SCHEMA', N'dbo',
'TABLE', N'TabletStyleDetail',
'COLUMN', N'Width'
GO


-- ----------------------------
-- Records of TabletStyleDetail
-- ----------------------------
BEGIN TRANSACTION
GO

INSERT INTO [dbo].[TabletStyleDetail] ([StyleID], [Name], [Descr], [ElementID], [StartX], [StartY], [FontSize], [BreakLen], [FontFamily], [TwoOffset], [ThreeOffset], [FourOffset], [IsActive], [CUser], [CDate], [CTime], [UUser], [UDate], [UTime], [Width]) VALUES (N'20260305170349', N'', N'', N'address', N'78.05', N'88.9', N'24', N'', N'Kaiti', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'')
GO

INSERT INTO [dbo].[TabletStyleDetail] ([StyleID], [Name], [Descr], [ElementID], [StartX], [StartY], [FontSize], [BreakLen], [FontFamily], [TwoOffset], [ThreeOffset], [FourOffset], [IsActive], [CUser], [CDate], [CTime], [UUser], [UDate], [UTime], [Width]) VALUES (N'20260305170349', N'', N'', N'alive', N'9.53', N'161.4', N'18', N'', N'Kaiti', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'', N'')
GO

INSERT INTO [dbo].[TabletStyleDetail] ([StyleID], [Name], [Descr], [ElementID], [StartX], [StartY], [FontSize], [BreakLen], [FontFamily], [TwoOffset], [ThreeOffset], [FourOffset], [IsActive], [CUser], [CDate], [CTime], [UUser], [UDate], [UTime], [Width]) VALUES (N'20260305170349', N'', N'', N'combined', N'10', N'80', N'24', N'', N'Kaiti', N'', N'', N'', N'hidden', N'', N'', N'', N'', N'', N'', N'')
GO

INSERT INTO [dbo].[TabletStyleDetail] ([StyleID], [Name], [Descr], [ElementID], [StartX], [StartY], [FontSize], [BreakLen], [FontFamily], [TwoOffset], [ThreeOffset], [FourOffset], [IsActive], [CUser], [CDate], [CTime], [UUser], [UDate], [UTime], [Width]) VALUES (N'20260305170349', N'', N'', N'lefttitle', N'10', N'80', N'24', N'', N'Kaiti', N'', N'', N'', N'hidden', N'', N'', N'', N'', N'', N'', N'')
GO

INSERT INTO [dbo].[TabletStyleDetail] ([StyleID], [Name], [Descr], [ElementID], [StartX], [StartY], [FontSize], [BreakLen], [FontFamily], [TwoOffset], [ThreeOffset], [FourOffset], [IsActive], [CUser], [CDate], [CTime], [UUser], [UDate], [UTime], [Width]) VALUES (N'20260305170349', N'', N'', N'righttitle', N'50', N'80', N'24', N'', N'Kaiti', N'', N'', N'', N'hidden', N'', N'', N'', N'', N'', N'', N'')
GO

INSERT INTO [dbo].[TabletStyleDetail] ([StyleID], [Name], [Descr], [ElementID], [StartX], [StartY], [FontSize], [BreakLen], [FontFamily], [TwoOffset], [ThreeOffset], [FourOffset], [IsActive], [CUser], [CDate], [CTime], [UUser], [UDate], [UTime], [Width]) VALUES (N'20260305170349', N'', N'', N'title1', N'45.51', N'91.81', N'24', N'12', N'Kaiti', N'10', N'20', N'30', N'', N'', N'', N'', N'', N'', N'', N'36')
GO

INSERT INTO [dbo].[TabletStyleDetail] ([StyleID], [Name], [Descr], [ElementID], [StartX], [StartY], [FontSize], [BreakLen], [FontFamily], [TwoOffset], [ThreeOffset], [FourOffset], [IsActive], [CUser], [CDate], [CTime], [UUser], [UDate], [UTime], [Width]) VALUES (N'20260305170349', N'', N'', N'titletriangle', N'10', N'80', N'24', N'', N'Kaiti', N'', N'', N'', N'hidden', N'', N'', N'', N'', N'', N'', N'')
GO

INSERT INTO [dbo].[TabletStyleDetail] ([StyleID], [Name], [Descr], [ElementID], [StartX], [StartY], [FontSize], [BreakLen], [FontFamily], [TwoOffset], [ThreeOffset], [FourOffset], [IsActive], [CUser], [CDate], [CTime], [UUser], [UDate], [UTime], [Width]) VALUES (N'20260305170349', N'', N'', N'tricombined', N'10', N'80', N'24', N'', N'Kaiti', N'', N'', N'', N'hidden', N'', N'', N'', N'', N'', N'', N'')
GO

COMMIT
GO


-- ----------------------------
-- Table structure for transfer_register
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[transfer_register]') AND type IN ('U'))
	DROP TABLE [dbo].[transfer_register]
GO

CREATE TABLE [dbo].[transfer_register] (
  [id] int  IDENTITY(1,1) NOT NULL,
  [activity_num] int  NULL,
  [name] nvarchar(50) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [phone] nvarchar(30) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [pay_type] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [account_last5] nvarchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [amount] decimal(12,2)  NULL,
  [pay_mode] nvarchar(10) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [note] nvarchar(200) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [proof_img] nvarchar(200) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [status] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [create_time] datetime  NULL,
  [f_num_match] int  NULL,
  [f_num] int  NULL,
  [acc_num] int  NULL,
  [check_date] datetime  NULL,
  [check_amount] decimal(12,2)  NULL,
  [check_memo] nvarchar(200) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [check_status] nvarchar(20) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [acc_kind] int  NULL,
  [member_num] int  NULL,
  [verify_time] datetime  NULL,
  [verify_note] nvarchar(200) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [remain_amount] decimal(12,2)  NULL,
  [draft] nvarchar(max) COLLATE Chinese_Taiwan_Stroke_CI_AS  NULL,
  [balance_act_item] int  NULL,
  [balance_pro_order_detail] int  NULL
)
GO

ALTER TABLE [dbo].[transfer_register] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'匯款沖帳表',
'SCHEMA', N'dbo',
'TABLE', N'transfer_register'
GO


-- ----------------------------
-- Records of transfer_register
-- ----------------------------
BEGIN TRANSACTION
GO

SET IDENTITY_INSERT [dbo].[transfer_register] ON
GO

SET IDENTITY_INSERT [dbo].[transfer_register] OFF
GO

COMMIT
GO


-- ----------------------------
-- View structure for 法會統計
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[法會統計]') AND type IN ('V'))
	DROP VIEW [dbo].[法會統計]
GO

CREATE VIEW [dbo].[法會統計] AS SELECT  TOP (100) PERCENT dbo.activity.num, dbo.activity.category_kind, dbo.activity_category_kind.kind AS 活動主類型, dbo.activity.kind, 
               dbo.activity_kind.kind AS 活動詳細分類, dbo.activity.subject AS 活動名稱, dbo.activity.startDate_solar AS 開始日期, 
               dbo.activity.endDate_solar AS 結束日期, dbo.activity.dueDate AS 報名截止日, SUM(dbo.pro_order_detail.qty) AS 功德數量, 
               SUM(dbo.pro_order_detail.price) AS 合計
FROM     dbo.pro_order_detail LEFT OUTER JOIN
               dbo.pro_order ON dbo.pro_order_detail.order_no = dbo.pro_order.order_no RIGHT OUTER JOIN
               dbo.activity ON dbo.pro_order.activity_num = dbo.activity.num LEFT OUTER JOIN
               dbo.activity_kind ON dbo.activity.kind = dbo.activity_kind.num LEFT OUTER JOIN
               dbo.activity_category_kind ON dbo.activity.category_kind = dbo.activity_category_kind.num
GROUP BY dbo.activity.num, dbo.activity.category_kind, dbo.activity_category_kind.kind, dbo.activity.kind, dbo.activity_kind.kind, dbo.activity.subject, 
               dbo.activity.startDate_solar, dbo.activity.endDate_solar, dbo.activity.dueDate
GO


-- ----------------------------
-- View structure for 報名明細查詢
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[報名明細查詢]') AND type IN ('V'))
	DROP VIEW [dbo].[報名明細查詢]
GO

CREATE VIEW [dbo].[報名明細查詢] AS SELECT  dbo.activity.num AS 法會ID, dbo.activity.subject AS 法會名稱, dbo.activity.startDate_solar AS 開始日期, dbo.activity.endDate_solar AS 結束日期, 
               dbo.followers.f_number AS 信眾編號, dbo.followers.u_name AS 信眾姓名, dbo.pro_order.order_no AS 報名編號, dbo.pro_order.up_time AS 報名日期, 
               CASE WHEN parent_num IS NOT NULL THEN '是' ELSE '否' END AS 功德主, dbo.actItem_kind.kind AS 功德類型, dbo.actItem.subject AS 功德名稱, 
               dbo.pro_order_detail.qty AS 數量, dbo.pro_order_detail.price AS 金額, 0 AS 已收, dbo.pro_order_detail.price * dbo.pro_order_detail.qty - 0 AS 未收
FROM     dbo.pro_order_detail INNER JOIN
               dbo.pro_order ON dbo.pro_order_detail.order_no = dbo.pro_order.order_no INNER JOIN
               dbo.actItem ON dbo.pro_order_detail.actItem_num = dbo.actItem.num INNER JOIN
               dbo.activity ON dbo.pro_order.activity_num = dbo.activity.num INNER JOIN
               dbo.followers ON dbo.pro_order.f_num = dbo.followers.num INNER JOIN
               dbo.actItem_kind ON dbo.actItem.kind = dbo.actItem_kind.num
GO


-- ----------------------------
-- procedure structure for pager_eztrust
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[pager_eztrust]') AND type IN ('P', 'PC', 'RF', 'X'))
	DROP PROCEDURE[dbo].[pager_eztrust]
GO

CREATE PROCEDURE [dbo].[pager_eztrust]
@StartRowIndex INT, @PageSize INT, @tableName NVARCHAR (3000), @columnName NVARCHAR (2000), @sqlWhere NVARCHAR (1000), @orderBy NVARCHAR (1000), @rowCount INT OUTPUT
WITH RECOMPILE
AS
DECLARE @sqlCount AS NVARCHAR (1000), @sqlDataTable AS NVARCHAR (3000), @LowerBand AS INT, @UpperBand AS INT;
SET @sqlCount = 'SELECT @rowCount=COUNT(*) FROM ' + @tableName + ' WHERE ' + @sqlWhere;
EXECUTE sp_executesql @sqlCount, N'@rowCount int output', @rowCount OUTPUT;
IF (@StartRowIndex = 0)
    BEGIN
        SET @LowerBand = 0;
        SET @UpperBand = @PageSize;
    END
ELSE
    BEGIN
        SET @LowerBand = @StartRowIndex + 1;
        SET @UpperBand = @StartRowIndex + @PageSize;
    END
SET @sqlDataTable = 'WITH tempTable AS
(SELECT ' + @columnName + ', ROW_NUMBER() OVER(ORDER BY ' + @orderBy + ') AS tempRowNum
FROM ' + @tableName + ' WHERE ' + @sqlWhere + ') 
SELECT * FROM tempTable WHERE tempRowNum BETWEEN ' + CAST (@LowerBand AS NVARCHAR) + ' AND ' + CAST (@UpperBand AS NVARCHAR) + ';';
EXECUTE (@sqlDataTable);
RETURN;
GO


-- ----------------------------
-- Auto increment value for accounting
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[accounting]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table accounting
-- ----------------------------
ALTER TABLE [dbo].[accounting] ADD CONSTRAINT [PK_accounting] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for accounting_files
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[accounting_files]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table accounting_files
-- ----------------------------
ALTER TABLE [dbo].[accounting_files] ADD CONSTRAINT [PK_accounting_files] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for accounting_kind
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[accounting_kind]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table accounting_kind
-- ----------------------------
ALTER TABLE [dbo].[accounting_kind] ADD CONSTRAINT [PK_accounting_kind] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for accounting_kind2
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[accounting_kind2]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table accounting_kind2
-- ----------------------------
ALTER TABLE [dbo].[accounting_kind2] ADD CONSTRAINT [PK_accounting_kind2] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for act_bom
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[act_bom]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table act_bom
-- ----------------------------
ALTER TABLE [dbo].[act_bom] ADD CONSTRAINT [PK_act_bom] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for actItem
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[actItem]', RESEED, 4)
GO


-- ----------------------------
-- Primary Key structure for table actItem
-- ----------------------------
ALTER TABLE [dbo].[actItem] ADD CONSTRAINT [PK_actItem] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for actItem_files
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[actItem_files]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table actItem_files
-- ----------------------------
ALTER TABLE [dbo].[actItem_files] ADD CONSTRAINT [PK_actItem_files] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for actItem_kind
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[actItem_kind]', RESEED, 4)
GO


-- ----------------------------
-- Primary Key structure for table actItem_kind
-- ----------------------------
ALTER TABLE [dbo].[actItem_kind] ADD CONSTRAINT [PK_actItem_kind] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for activity
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[activity]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table activity
-- ----------------------------
ALTER TABLE [dbo].[activity] ADD CONSTRAINT [PK_activity] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for activity_category_kind
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[activity_category_kind]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table activity_category_kind
-- ----------------------------
ALTER TABLE [dbo].[activity_category_kind] ADD CONSTRAINT [PK_activity_category_kind] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for activity_check
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[activity_check]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table activity_check
-- ----------------------------
ALTER TABLE [dbo].[activity_check] ADD CONSTRAINT [PK_activity_check] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for activity_kind
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[activity_kind]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table activity_kind
-- ----------------------------
ALTER TABLE [dbo].[activity_kind] ADD CONSTRAINT [PK_activity_kind] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for activity_kind_detail
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[activity_kind_detail]', RESEED, 2)
GO


-- ----------------------------
-- Primary Key structure for table activity_kind_detail
-- ----------------------------
ALTER TABLE [dbo].[activity_kind_detail] ADD CONSTRAINT [PK_activity_kind_detail] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for activity_relating
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[activity_relating]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table activity_relating
-- ----------------------------
ALTER TABLE [dbo].[activity_relating] ADD CONSTRAINT [PK_activity_relating] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for activity_spares
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[activity_spares]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table activity_spares
-- ----------------------------
ALTER TABLE [dbo].[activity_spares] ADD CONSTRAINT [PK_activity_spares] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for admin
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[admin]', RESEED, 19)
GO


-- ----------------------------
-- Primary Key structure for table admin
-- ----------------------------
ALTER TABLE [dbo].[admin] ADD CONSTRAINT [PK_admin] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table admin_group
-- ----------------------------
ALTER TABLE [dbo].[admin_group] ADD CONSTRAINT [PK_admin_group_1] PRIMARY KEY CLUSTERED ([g_name])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for admin_log
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[admin_log]', RESEED, 7014)
GO


-- ----------------------------
-- Primary Key structure for table admin_log
-- ----------------------------
ALTER TABLE [dbo].[admin_log] ADD CONSTRAINT [PK_admin_log] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for AncestralTabletArea
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[AncestralTabletArea]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table AncestralTabletArea
-- ----------------------------
ALTER TABLE [dbo].[AncestralTabletArea] ADD CONSTRAINT [PK__Ancestra__70B820489B4960D4] PRIMARY KEY CLUSTERED ([AreaId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for AncestralTabletPosition
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[AncestralTabletPosition]', RESEED, 1)
GO


-- ----------------------------
-- Uniques structure for table AncestralTabletPosition
-- ----------------------------
ALTER TABLE [dbo].[AncestralTabletPosition] ADD CONSTRAINT [UQ_Position_Area_Code] UNIQUE NONCLUSTERED ([AreaId] ASC, [PositionCode] ASC)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table AncestralTabletPosition
-- ----------------------------
ALTER TABLE [dbo].[AncestralTabletPosition] ADD CONSTRAINT [PK__Ancestra__60BB9A79DEE207E0] PRIMARY KEY CLUSTERED ([PositionId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for AncestralTabletPositionRecord
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[AncestralTabletPositionRecord]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table AncestralTabletPositionRecord
-- ----------------------------
ALTER TABLE [dbo].[AncestralTabletPositionRecord] ADD CONSTRAINT [PK__Ancestra__FBDF78E98477ACD3] PRIMARY KEY CLUSTERED ([RecordId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table AncestralTabletRegistrant
-- ----------------------------
ALTER TABLE [dbo].[AncestralTabletRegistrant] ADD CONSTRAINT [PK__Ancestra__A40DAC21E847E256] PRIMARY KEY CLUSTERED ([RegistrantCode])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table AncestralTabletStatus
-- ----------------------------
ALTER TABLE [dbo].[AncestralTabletStatus] ADD CONSTRAINT [PK__Ancestra__6A7B44FDBE24A5D8] PRIMARY KEY CLUSTERED ([StatusCode])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for appellation
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[appellation]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table appellation
-- ----------------------------
ALTER TABLE [dbo].[appellation] ADD CONSTRAINT [PK_appellation] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for bed_kind
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[bed_kind]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table bed_kind
-- ----------------------------
ALTER TABLE [dbo].[bed_kind] ADD CONSTRAINT [PK_bed_kind] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for bed_kind_detail
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[bed_kind_detail]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table bed_kind_detail
-- ----------------------------
ALTER TABLE [dbo].[bed_kind_detail] ADD CONSTRAINT [PK_bed_kind_detail] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table bed_order
-- ----------------------------
ALTER TABLE [dbo].[bed_order] ADD CONSTRAINT [PK_bed_order_1] PRIMARY KEY CLUSTERED ([bed_order_no])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for bed_order_detail
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[bed_order_detail]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table bed_order_detail
-- ----------------------------
ALTER TABLE [dbo].[bed_order_detail] ADD CONSTRAINT [PK_bed_order_detail] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for company
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[company]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table company
-- ----------------------------
ALTER TABLE [dbo].[company] ADD CONSTRAINT [PK_company] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table country
-- ----------------------------
ALTER TABLE [dbo].[country] ADD CONSTRAINT [PK_country] PRIMARY KEY CLUSTERED ([ID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for family_members
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[family_members]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table family_members
-- ----------------------------
ALTER TABLE [dbo].[family_members] ADD CONSTRAINT [PK__family_m__DF908D65D8141140] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for files
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[files]', RESEED, 210)
GO


-- ----------------------------
-- Primary Key structure for table files
-- ----------------------------
ALTER TABLE [dbo].[files] ADD CONSTRAINT [PK_files] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for followers
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[followers]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table followers
-- ----------------------------
ALTER TABLE [dbo].[followers] ADD CONSTRAINT [PK_followers] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for followers_tablet
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[followers_tablet]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table followers_tablet
-- ----------------------------
ALTER TABLE [dbo].[followers_tablet] ADD CONSTRAINT [PK_followers_tablet] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Uniques structure for table GuaDanOrder
-- ----------------------------
ALTER TABLE [dbo].[GuaDanOrder] ADD CONSTRAINT [UQ_GuaDanOrderNo] UNIQUE NONCLUSTERED ([GuaDanOrderNo] ASC)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table GuaDanOrder
-- ----------------------------
ALTER TABLE [dbo].[GuaDanOrder] ADD CONSTRAINT [PK_GuaDanOrder] PRIMARY KEY CLUSTERED ([Uuid])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table GuaDanOrderGuest
-- ----------------------------
ALTER TABLE [dbo].[GuaDanOrderGuest] ADD CONSTRAINT [PK_GuaDanOrderGuest] PRIMARY KEY CLUSTERED ([Uuid])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table GuadanTimeSetting
-- ----------------------------
ALTER TABLE [dbo].[GuadanTimeSetting] ADD CONSTRAINT [PK__GuadanTi__3214EC07A8F6FDD4] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for item
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[item]', RESEED, 1086)
GO


-- ----------------------------
-- Primary Key structure for table item
-- ----------------------------
ALTER TABLE [dbo].[item] ADD CONSTRAINT [PK_item] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for member
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[member]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table member
-- ----------------------------
ALTER TABLE [dbo].[member] ADD CONSTRAINT [PK_member] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for member_check
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[member_check]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table member_check
-- ----------------------------
ALTER TABLE [dbo].[member_check] ADD CONSTRAINT [PK_member_check] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for member_group
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[member_group]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table member_group
-- ----------------------------
ALTER TABLE [dbo].[member_group] ADD CONSTRAINT [PK_member_kind] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for member_title
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[member_title]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table member_title
-- ----------------------------
ALTER TABLE [dbo].[member_title] ADD CONSTRAINT [PK_member_title] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for news
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[news]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table news
-- ----------------------------
ALTER TABLE [dbo].[news] ADD CONSTRAINT [PK_news] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table news_files
-- ----------------------------
ALTER TABLE [dbo].[news_files] ADD CONSTRAINT [PK_news_files_1] PRIMARY KEY CLUSTERED ([num], [news_id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for news_kind
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[news_kind]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table news_kind
-- ----------------------------
ALTER TABLE [dbo].[news_kind] ADD CONSTRAINT [PK_news_kind] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table PostCity
-- ----------------------------
ALTER TABLE [dbo].[PostCity] ADD CONSTRAINT [PK_PostCity] PRIMARY KEY CLUSTERED ([city])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table PostNumber
-- ----------------------------
ALTER TABLE [dbo].[PostNumber] ADD CONSTRAINT [PK_PostNumber] PRIMARY KEY CLUSTERED ([ID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table pro_order
-- ----------------------------
ALTER TABLE [dbo].[pro_order] ADD CONSTRAINT [PK_pro_order] PRIMARY KEY CLUSTERED ([order_no])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for pro_order_detail
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[pro_order_detail]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table pro_order_detail
-- ----------------------------
ALTER TABLE [dbo].[pro_order_detail] ADD CONSTRAINT [PK_pro_order2] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for pro_order_record
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[pro_order_record]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table pro_order_record
-- ----------------------------
ALTER TABLE [dbo].[pro_order_record] ADD CONSTRAINT [PK_pro_order_record] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for project
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[project]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table project
-- ----------------------------
ALTER TABLE [dbo].[project] ADD CONSTRAINT [PK_project1] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for project_kind
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[project_kind]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table project_kind
-- ----------------------------
ALTER TABLE [dbo].[project_kind] ADD CONSTRAINT [PK_project] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for project_sub
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[project_sub]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table project_sub
-- ----------------------------
ALTER TABLE [dbo].[project_sub] ADD CONSTRAINT [PK_project_sub] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Region
-- ----------------------------
ALTER TABLE [dbo].[Region] ADD CONSTRAINT [PK_Region] PRIMARY KEY CLUSTERED ([Uuid])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table RegionAndRoomAndBedSchedule
-- ----------------------------
ALTER TABLE [dbo].[RegionAndRoomAndBedSchedule] ADD CONSTRAINT [PK_RegionAndRoomAndBedSchedule] PRIMARY KEY CLUSTERED ([Uuid])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table RegionRoomBed
-- ----------------------------
ALTER TABLE [dbo].[RegionRoomBed] ADD CONSTRAINT [PK_RegionRoomBed] PRIMARY KEY CLUSTERED ([Uuid])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table RegionRoomBedStatus
-- ----------------------------
ALTER TABLE [dbo].[RegionRoomBedStatus] ADD CONSTRAINT [PK_RegionRoomBedStatus] PRIMARY KEY CLUSTERED ([Code])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Uniques structure for table RegionType
-- ----------------------------
ALTER TABLE [dbo].[RegionType] ADD CONSTRAINT [UQ__RegionTy__A25C5AA7D0316CA7] UNIQUE NONCLUSTERED ([Code] ASC)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table RegionType
-- ----------------------------
ALTER TABLE [dbo].[RegionType] ADD CONSTRAINT [PK__RegionTy__3214EC07ACAB030A] PRIMARY KEY CLUSTERED ([Uuid])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Room
-- ----------------------------
ALTER TABLE [dbo].[Room] ADD CONSTRAINT [PK__Room__3214EC0730203C74] PRIMARY KEY CLUSTERED ([Uuid])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for ShuWen
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[ShuWen]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table ShuWen
-- ----------------------------
ALTER TABLE [dbo].[ShuWen] ADD CONSTRAINT [PK__ShuWen__3214EC274DFCFFE3] PRIMARY KEY CLUSTERED ([ID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for stock
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[stock]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table stock
-- ----------------------------
ALTER TABLE [dbo].[stock] ADD CONSTRAINT [PK_stock] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for stock_files
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[stock_files]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table stock_files
-- ----------------------------
ALTER TABLE [dbo].[stock_files] ADD CONSTRAINT [PK_stock_files] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for stock_kind
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[stock_kind]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table stock_kind
-- ----------------------------
ALTER TABLE [dbo].[stock_kind] ADD CONSTRAINT [PK_stock_kind] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for stock_reason
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[stock_reason]', RESEED, 3)
GO


-- ----------------------------
-- Primary Key structure for table stock_reason
-- ----------------------------
ALTER TABLE [dbo].[stock_reason] ADD CONSTRAINT [PK_stock_reason] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for supplier
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[supplier]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table supplier
-- ----------------------------
ALTER TABLE [dbo].[supplier] ADD CONSTRAINT [PK_supplier] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for supplier_kind
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[supplier_kind]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table supplier_kind
-- ----------------------------
ALTER TABLE [dbo].[supplier_kind] ADD CONSTRAINT [PK_supplier_kind] PRIMARY KEY CLUSTERED ([num])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table TabletElement
-- ----------------------------
ALTER TABLE [dbo].[TabletElement] ADD CONSTRAINT [PK__TabletEl__A429723A177DDC17] PRIMARY KEY CLUSTERED ([ElementID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table TabletStyle
-- ----------------------------
ALTER TABLE [dbo].[TabletStyle] ADD CONSTRAINT [PK__TabletSt__8AD147A0A14FBD77] PRIMARY KEY CLUSTERED ([StyleID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table TabletStyleDetail
-- ----------------------------
ALTER TABLE [dbo].[TabletStyleDetail] ADD CONSTRAINT [PK__TabletSt__8AD147A05581A030] PRIMARY KEY CLUSTERED ([StyleID], [ElementID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for transfer_register
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[transfer_register]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table transfer_register
-- ----------------------------
ALTER TABLE [dbo].[transfer_register] ADD CONSTRAINT [PK__transfer__3213E83F082312F3] PRIMARY KEY CLUSTERED ([id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Foreign Keys structure for table accounting
-- ----------------------------
ALTER TABLE [dbo].[accounting] ADD CONSTRAINT [FK_accounting_accounting_kind] FOREIGN KEY ([kind]) REFERENCES [dbo].[accounting_kind] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[accounting] ADD CONSTRAINT [FK_accounting_accounting_kind2] FOREIGN KEY ([kind2]) REFERENCES [dbo].[accounting_kind2] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[accounting] ADD CONSTRAINT [FK_accounting_activity] FOREIGN KEY ([activity_num]) REFERENCES [dbo].[activity] ([num]) ON DELETE SET NULL ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[accounting] ADD CONSTRAINT [FK_accounting_member] FOREIGN KEY ([mem_num]) REFERENCES [dbo].[member] ([num]) ON DELETE SET NULL ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[accounting] ADD CONSTRAINT [FK_accounting_pro_order_detail] FOREIGN KEY ([pro_order_detail_num]) REFERENCES [dbo].[pro_order_detail] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table accounting_files
-- ----------------------------
ALTER TABLE [dbo].[accounting_files] ADD CONSTRAINT [FK_accounting_files_accounting] FOREIGN KEY ([accounting_num]) REFERENCES [dbo].[accounting] ([num]) ON DELETE CASCADE ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table act_bom
-- ----------------------------
ALTER TABLE [dbo].[act_bom] ADD CONSTRAINT [FK_act_bom_act_bom] FOREIGN KEY ([package_num]) REFERENCES [dbo].[act_bom] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[act_bom] ADD CONSTRAINT [FK_act_bom_actItem1] FOREIGN KEY ([item_num]) REFERENCES [dbo].[actItem] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table actItem
-- ----------------------------
ALTER TABLE [dbo].[actItem] ADD CONSTRAINT [FK_actItem_actItem_kind] FOREIGN KEY ([kind]) REFERENCES [dbo].[actItem_kind] ([num]) ON DELETE SET NULL ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table actItem_files
-- ----------------------------
ALTER TABLE [dbo].[actItem_files] ADD CONSTRAINT [FK_actItem_files_actItem] FOREIGN KEY ([actItem_num]) REFERENCES [dbo].[actItem] ([num]) ON DELETE CASCADE ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table activity
-- ----------------------------
ALTER TABLE [dbo].[activity] ADD CONSTRAINT [FK_activity_activity_category_kind] FOREIGN KEY ([category_kind]) REFERENCES [dbo].[activity_category_kind] ([num]) ON DELETE SET NULL ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table activity_check
-- ----------------------------
ALTER TABLE [dbo].[activity_check] ADD CONSTRAINT [FK_activity_check_activity] FOREIGN KEY ([activity_num]) REFERENCES [dbo].[activity] ([num]) ON DELETE CASCADE ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[activity_check] ADD CONSTRAINT [FK_activity_check_followers] FOREIGN KEY ([f_num]) REFERENCES [dbo].[followers] ([num]) ON DELETE CASCADE ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table activity_kind_detail
-- ----------------------------
ALTER TABLE [dbo].[activity_kind_detail] ADD CONSTRAINT [FK_activity_kind_detail_actItem] FOREIGN KEY ([actItem_num]) REFERENCES [dbo].[actItem] ([num]) ON DELETE CASCADE ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[activity_kind_detail] ADD CONSTRAINT [FK_activity_kind_detail_activity_kind] FOREIGN KEY ([activity_kind_num]) REFERENCES [dbo].[activity_kind] ([num]) ON DELETE CASCADE ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table activity_relating
-- ----------------------------
ALTER TABLE [dbo].[activity_relating] ADD CONSTRAINT [FK_activity_relating_actItem] FOREIGN KEY ([actItem_num]) REFERENCES [dbo].[actItem] ([num]) ON DELETE CASCADE ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[activity_relating] ADD CONSTRAINT [FK_activity_relating_activity] FOREIGN KEY ([activity_num]) REFERENCES [dbo].[activity] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table activity_spares
-- ----------------------------
ALTER TABLE [dbo].[activity_spares] ADD CONSTRAINT [FK_activity_spares_actItem] FOREIGN KEY ([actItem_num]) REFERENCES [dbo].[actItem] ([num]) ON DELETE CASCADE ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[activity_spares] ADD CONSTRAINT [FK_activity_spares_activity] FOREIGN KEY ([activity_num]) REFERENCES [dbo].[activity] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table admin
-- ----------------------------
ALTER TABLE [dbo].[admin] ADD CONSTRAINT [FK_admin_admin_group] FOREIGN KEY ([power]) REFERENCES [dbo].[admin_group] ([g_name]) ON DELETE SET NULL ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table AncestralTabletArea
-- ----------------------------
ALTER TABLE [dbo].[AncestralTabletArea] ADD CONSTRAINT [FK_AncestralTabletArea_Parent] FOREIGN KEY ([ParentAreaId]) REFERENCES [dbo].[AncestralTabletArea] ([AreaId]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table AncestralTabletPosition
-- ----------------------------
ALTER TABLE [dbo].[AncestralTabletPosition] ADD CONSTRAINT [FK_Position_Area] FOREIGN KEY ([AreaId]) REFERENCES [dbo].[AncestralTabletArea] ([AreaId]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[AncestralTabletPosition] ADD CONSTRAINT [FK_Position_Status] FOREIGN KEY ([StatusCode]) REFERENCES [dbo].[AncestralTabletStatus] ([StatusCode]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table AncestralTabletPositionRecord
-- ----------------------------
ALTER TABLE [dbo].[AncestralTabletPositionRecord] ADD CONSTRAINT [FK__Ancestral__Regis__1A9EF37A] FOREIGN KEY ([RegistrantCode]) REFERENCES [dbo].[AncestralTabletRegistrant] ([RegistrantCode]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table AncestralTabletRegistrant
-- ----------------------------
ALTER TABLE [dbo].[AncestralTabletRegistrant] ADD CONSTRAINT [FK_Registrant_Position] FOREIGN KEY ([PositionId]) REFERENCES [dbo].[AncestralTabletPosition] ([PositionId]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table bed_kind_detail
-- ----------------------------
ALTER TABLE [dbo].[bed_kind_detail] ADD CONSTRAINT [FK_bed_kind_detail_bed_kind] FOREIGN KEY ([bed_kind_id]) REFERENCES [dbo].[bed_kind] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table bed_order
-- ----------------------------
ALTER TABLE [dbo].[bed_order] ADD CONSTRAINT [FK_bed_order_pro_order] FOREIGN KEY ([order_no]) REFERENCES [dbo].[pro_order] ([order_no]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[bed_order] ADD CONSTRAINT [FK_bed_order_pro_order_detail] FOREIGN KEY ([o_detail_id]) REFERENCES [dbo].[pro_order_detail] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table bed_order_detail
-- ----------------------------
ALTER TABLE [dbo].[bed_order_detail] ADD CONSTRAINT [FK_bed_order_detail_bed_kind] FOREIGN KEY ([bed_kind1]) REFERENCES [dbo].[bed_kind] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[bed_order_detail] ADD CONSTRAINT [FK_bed_order_detail_bed_kind_detail] FOREIGN KEY ([bed_kind_detail_id]) REFERENCES [dbo].[bed_kind_detail] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[bed_order_detail] ADD CONSTRAINT [FK_bed_order_detail_bed_kind1] FOREIGN KEY ([bed_kind2]) REFERENCES [dbo].[bed_kind] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[bed_order_detail] ADD CONSTRAINT [FK_bed_order_detail_bed_order] FOREIGN KEY ([bed_order_no]) REFERENCES [dbo].[bed_order] ([bed_order_no]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table family_members
-- ----------------------------
ALTER TABLE [dbo].[family_members] ADD CONSTRAINT [FK_family_members_followers] FOREIGN KEY ([follower_num]) REFERENCES [dbo].[followers] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table followers
-- ----------------------------
ALTER TABLE [dbo].[followers] ADD CONSTRAINT [FK_followers_appellation] FOREIGN KEY ([appellation_id]) REFERENCES [dbo].[appellation] ([num]) ON DELETE SET NULL ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[followers] ADD CONSTRAINT [FK_followers_country] FOREIGN KEY ([country]) REFERENCES [dbo].[country] ([ID]) ON DELETE SET NULL ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[followers] ADD CONSTRAINT [FK_followers_followers] FOREIGN KEY ([leader]) REFERENCES [dbo].[followers] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table followers_tablet
-- ----------------------------
ALTER TABLE [dbo].[followers_tablet] ADD CONSTRAINT [FK_followers_tablet_followers] FOREIGN KEY ([f_num]) REFERENCES [dbo].[followers] ([num]) ON DELETE CASCADE ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table GuaDanOrder
-- ----------------------------
ALTER TABLE [dbo].[GuaDanOrder] ADD CONSTRAINT [FK_GuaDanOrder_Admin_CreateUser] FOREIGN KEY ([CreateUser]) REFERENCES [dbo].[admin] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[GuaDanOrder] ADD CONSTRAINT [FK_GuaDanOrder_Followers] FOREIGN KEY ([BookerFollowerNum]) REFERENCES [dbo].[followers] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table GuaDanOrderGuest
-- ----------------------------
ALTER TABLE [dbo].[GuaDanOrderGuest] ADD CONSTRAINT [FK_GuaDanOrderGuest_BedUuid] FOREIGN KEY ([BedUuid]) REFERENCES [dbo].[RegionRoomBed] ([Uuid]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[GuaDanOrderGuest] ADD CONSTRAINT [FK_GuaDanOrderGuest_FOLLOWERS] FOREIGN KEY ([FollowerNum]) REFERENCES [dbo].[followers] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[GuaDanOrderGuest] ADD CONSTRAINT [FK_GuaDanOrderGuest_Order] FOREIGN KEY ([OrderUuid]) REFERENCES [dbo].[GuaDanOrder] ([Uuid]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[GuaDanOrderGuest] ADD CONSTRAINT [FK_GuaDanOrderGuest_RoomUuid] FOREIGN KEY ([RoomUuid]) REFERENCES [dbo].[Room] ([Uuid]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[GuaDanOrderGuest] ADD CONSTRAINT [FK_GuaDanOrderGuest_StatusCode] FOREIGN KEY ([StatusCode]) REFERENCES [dbo].[RegionRoomBedStatus] ([Code]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table member
-- ----------------------------
ALTER TABLE [dbo].[member] ADD CONSTRAINT [FK_member_admin] FOREIGN KEY ([admin_num]) REFERENCES [dbo].[admin] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[member] ADD CONSTRAINT [FK_member_followers] FOREIGN KEY ([f_num]) REFERENCES [dbo].[followers] ([num]) ON DELETE SET NULL ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[member] ADD CONSTRAINT [FK_member_member_group] FOREIGN KEY ([group_kind]) REFERENCES [dbo].[member_group] ([num]) ON DELETE SET NULL ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[member] ADD CONSTRAINT [FK_member_member_title] FOREIGN KEY ([title_kind]) REFERENCES [dbo].[member_title] ([num]) ON DELETE SET NULL ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table member_check
-- ----------------------------
ALTER TABLE [dbo].[member_check] ADD CONSTRAINT [FK_member_check_member] FOREIGN KEY ([mem_num]) REFERENCES [dbo].[member] ([num]) ON DELETE CASCADE ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table news
-- ----------------------------
ALTER TABLE [dbo].[news] ADD CONSTRAINT [FK_news_activity] FOREIGN KEY ([activity_num]) REFERENCES [dbo].[activity] ([num]) ON DELETE SET NULL ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[news] ADD CONSTRAINT [FK_news_admin] FOREIGN KEY ([author]) REFERENCES [dbo].[admin] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[news] ADD CONSTRAINT [FK_news_news_kind] FOREIGN KEY ([kind]) REFERENCES [dbo].[news_kind] ([num]) ON DELETE SET NULL ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table news_files
-- ----------------------------
ALTER TABLE [dbo].[news_files] ADD CONSTRAINT [FK_news_files_news] FOREIGN KEY ([news_id]) REFERENCES [dbo].[news] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table pro_order
-- ----------------------------
ALTER TABLE [dbo].[pro_order] ADD CONSTRAINT [FK_pro_order_activity] FOREIGN KEY ([activity_num]) REFERENCES [dbo].[activity] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[pro_order] ADD CONSTRAINT [FK_pro_order_followers] FOREIGN KEY ([f_num]) REFERENCES [dbo].[followers] ([num]) ON DELETE SET NULL ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[pro_order] ADD CONSTRAINT [FK_pro_order_introducer] FOREIGN KEY ([introducer]) REFERENCES [dbo].[followers] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table pro_order_detail
-- ----------------------------
ALTER TABLE [dbo].[pro_order_detail] ADD CONSTRAINT [FK_pro_order_detail_actItem] FOREIGN KEY ([actItem_num]) REFERENCES [dbo].[actItem] ([num]) ON DELETE CASCADE ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[pro_order_detail] ADD CONSTRAINT [FK_pro_order_detail_followers] FOREIGN KEY ([f_num]) REFERENCES [dbo].[followers] ([num]) ON DELETE SET NULL ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[pro_order_detail] ADD CONSTRAINT [FK_pro_order_detail_followers1] FOREIGN KEY ([from_id]) REFERENCES [dbo].[followers] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[pro_order_detail] ADD CONSTRAINT [FK_pro_order_detail_pro_order] FOREIGN KEY ([order_no]) REFERENCES [dbo].[pro_order] ([order_no]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table pro_order_record
-- ----------------------------
ALTER TABLE [dbo].[pro_order_record] ADD CONSTRAINT [FK_pro_order_record_accounting_kind2] FOREIGN KEY ([payment]) REFERENCES [dbo].[accounting_kind2] ([num]) ON DELETE SET NULL ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[pro_order_record] ADD CONSTRAINT [FK_pro_order_record_pro_order_detail] FOREIGN KEY ([detail_num]) REFERENCES [dbo].[pro_order_detail] ([num]) ON DELETE CASCADE ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[pro_order_record] ADD CONSTRAINT [FK_pro_order_record_transfer_register] FOREIGN KEY ([transfer_id]) REFERENCES [dbo].[transfer_register] ([id]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table project
-- ----------------------------
ALTER TABLE [dbo].[project] ADD CONSTRAINT [FK_project_actItem] FOREIGN KEY ([actItem_num]) REFERENCES [dbo].[actItem] ([num]) ON DELETE CASCADE ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[project] ADD CONSTRAINT [FK_project_project_kind] FOREIGN KEY ([kind]) REFERENCES [dbo].[project_kind] ([num]) ON DELETE SET NULL ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table project_sub
-- ----------------------------
ALTER TABLE [dbo].[project_sub] ADD CONSTRAINT [FK_project_sub_project] FOREIGN KEY ([pro_id]) REFERENCES [dbo].[project] ([num]) ON DELETE CASCADE ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table Region
-- ----------------------------
ALTER TABLE [dbo].[Region] ADD CONSTRAINT [FK_Region_ParentUuid] FOREIGN KEY ([ParentUuid]) REFERENCES [dbo].[Region] ([Uuid]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[Region] ADD CONSTRAINT [FK_Region_RegionTypeUuid] FOREIGN KEY ([RegionTypeUuid]) REFERENCES [dbo].[RegionType] ([Uuid]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table RegionAndRoomAndBedSchedule
-- ----------------------------
ALTER TABLE [dbo].[RegionAndRoomAndBedSchedule] ADD CONSTRAINT [FK_Schedule_GuaDanOrderGuest] FOREIGN KEY ([GuaDanOrderGuestUuid]) REFERENCES [dbo].[GuaDanOrderGuest] ([Uuid]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table RegionRoomBed
-- ----------------------------
ALTER TABLE [dbo].[RegionRoomBed] ADD CONSTRAINT [FK_RegionRoomBed_RoomUuid] FOREIGN KEY ([RoomUuid]) REFERENCES [dbo].[Room] ([Uuid]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[RegionRoomBed] ADD CONSTRAINT [FK_RegionRoomBed_StatusCode] FOREIGN KEY ([StatusCode]) REFERENCES [dbo].[RegionRoomBedStatus] ([Code]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table Room
-- ----------------------------
ALTER TABLE [dbo].[Room] ADD CONSTRAINT [FK_Room_Region] FOREIGN KEY ([RegionUuid]) REFERENCES [dbo].[Region] ([Uuid]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table stock
-- ----------------------------
ALTER TABLE [dbo].[stock] ADD CONSTRAINT [FK_stock_actItem] FOREIGN KEY ([actItem_num]) REFERENCES [dbo].[actItem] ([num]) ON DELETE CASCADE ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[stock] ADD CONSTRAINT [FK_stock_activity] FOREIGN KEY ([activity_num]) REFERENCES [dbo].[activity] ([num]) ON DELETE SET NULL ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[stock] ADD CONSTRAINT [FK_stock_member] FOREIGN KEY ([mem_num]) REFERENCES [dbo].[member] ([num]) ON DELETE SET NULL ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[stock] ADD CONSTRAINT [FK_stock_stock_kind] FOREIGN KEY ([kind]) REFERENCES [dbo].[stock_kind] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[stock] ADD CONSTRAINT [FK_stock_stock_reason] FOREIGN KEY ([reason]) REFERENCES [dbo].[stock_reason] ([num]) ON DELETE SET NULL ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[stock] ADD CONSTRAINT [FK_stock_supplier] FOREIGN KEY ([supplier]) REFERENCES [dbo].[supplier] ([num]) ON DELETE SET NULL ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table stock_files
-- ----------------------------
ALTER TABLE [dbo].[stock_files] ADD CONSTRAINT [FK_stock_files_stock] FOREIGN KEY ([stock_num]) REFERENCES [dbo].[stock] ([num]) ON DELETE CASCADE ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table supplier
-- ----------------------------
ALTER TABLE [dbo].[supplier] ADD CONSTRAINT [FK_supplier_supplier_kind] FOREIGN KEY ([kind]) REFERENCES [dbo].[supplier_kind] ([num]) ON DELETE SET NULL ON UPDATE NO ACTION
GO


-- ----------------------------
-- Foreign Keys structure for table transfer_register
-- ----------------------------
ALTER TABLE [dbo].[transfer_register] ADD CONSTRAINT [FK_transfer_register_accounting_kind2] FOREIGN KEY ([acc_num]) REFERENCES [dbo].[accounting_kind2] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[transfer_register] ADD CONSTRAINT [FK_transfer_register_accountings] FOREIGN KEY ([acc_kind]) REFERENCES [dbo].[accounting] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[transfer_register] ADD CONSTRAINT [FK_transfer_register_actItem] FOREIGN KEY ([balance_act_item]) REFERENCES [dbo].[actItem] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[transfer_register] ADD CONSTRAINT [FK_transfer_register_activity] FOREIGN KEY ([activity_num]) REFERENCES [dbo].[activity] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[transfer_register] ADD CONSTRAINT [FK_transfer_register_followers] FOREIGN KEY ([f_num]) REFERENCES [dbo].[followers] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[transfer_register] ADD CONSTRAINT [FK_transfer_register_followers_match] FOREIGN KEY ([f_num_match]) REFERENCES [dbo].[followers] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[transfer_register] ADD CONSTRAINT [FK_transfer_register_member] FOREIGN KEY ([member_num]) REFERENCES [dbo].[member] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

ALTER TABLE [dbo].[transfer_register] ADD CONSTRAINT [FK_transfer_register_pro_order_detail] FOREIGN KEY ([balance_pro_order_detail]) REFERENCES [dbo].[pro_order_detail] ([num]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO

