h-you / branches / ddl / 20170525_SQL.txt @ 166
履歴 | 表示 | アノテート | ダウンロード (2.42 KB)
1 |
DROP TABLE IF EXISTS SystemMaster_OLD; |
---|---|
2 |
CREATE TABLE SystemMaster_OLD As Select * from SystemMaster; |
3 |
DROP TABLE IF EXISTS SystemMaster; |
4 |
|
5 |
-- ????}?X?^ |
6 |
CREATE TABLE SystemMaster |
7 |
( |
8 |
SystemCode decimal(3,0) unsigned NOT NULL COMMENT '???R?[?h', |
9 |
CompanyName1 varchar(60) DEFAULT '' NOT NULL COMMENT '?????P', |
10 |
CompanyName2 varchar(60) DEFAULT '' COMMENT '?????Q', |
11 |
CEOName varchar(60) DEFAULT '' NOT NULL COMMENT '??\?????', |
12 |
CEOPositionName varchar(60) DEFAULT '' COMMENT '??\???E??', |
13 |
ZipCode varchar(8) NOT NULL COMMENT '?X????', |
14 |
Address1 varchar(60) NOT NULL COMMENT '?Z???P', |
15 |
Address2 varchar(60) DEFAULT '' COMMENT '?Z??2', |
16 |
Address3 varchar(60) COMMENT '?Z??3', |
17 |
PhoneNumber varchar(13) DEFAULT '' NOT NULL COMMENT '?d?b???', |
18 |
FaxNumber varchar(13) DEFAULT '' COMMENT 'FAX???', |
19 |
HomePageURL varchar(120) DEFAULT '' COMMENT '?z?[???y?[?WURL', |
20 |
ConstructionExpenses decimal(4,2) NOT NULL COMMENT '?H?????o??', |
21 |
OfficeExpenses decimal(4,2) NOT NULL COMMENT '???????o??', |
22 |
OperatingExpenses decimal(4,2) NOT NULL COMMENT '?c??o??', |
23 |
ConsumptionTax decimal(4,2) NOT NULL COMMENT '?????', |
24 |
CooperationRate decimal(4,2) NOT NULL COMMENT '???????', |
25 |
StatutoryWelfareRate decimal(4,2) NOT NULL COMMENT '?@???????', |
26 |
ExcelSavePath varchar(120) COMMENT 'Excel????p?X', |
27 |
BusinessPeriod smallint NOT NULL COMMENT '????c?????', |
28 |
ConstructionYear smallint NOT NULL COMMENT '????H???N?x', |
29 |
BusinessBeginningDate varchar(5) NOT NULL COMMENT '?c????????', |
30 |
ConstructionBeginningDate varchar(5) NOT NULL COMMENT '?H???N?x?????', |
31 |
ConstructionNoBase decimal(1) NOT NULL COMMENT '?H????????l', |
32 |
SloganString1 varchar(100) COMMENT '?W??1', |
33 |
SloganString2 varchar(100) COMMENT '?W??2', |
34 |
SloganString3 varchar(100) COMMENT '?W??3', |
35 |
EntryDate datetime NOT NULL COMMENT '?o?^???t', |
36 |
UpdateDate datetime NOT NULL COMMENT '?X?V???t', |
37 |
PRIMARY KEY (SystemCode) |
38 |
) COMMENT = '????}?X?^'; |
39 |
|
40 |
Insert INTO SystemMaster |
41 |
SELECT |
42 |
SystemCode, |
43 |
CompanyName1, |
44 |
CompanyName2, |
45 |
CEOName, |
46 |
CEOPositionName, |
47 |
ZipCode, |
48 |
Address1, |
49 |
Address2, |
50 |
Address3, |
51 |
PhoneNumber, |
52 |
FaxNumber, |
53 |
'', |
54 |
ConstructionExpenses, |
55 |
OfficeExpenses, |
56 |
OperatingExpenses, |
57 |
ConsumptionTax, |
58 |
CooperationRate, |
59 |
8.0, |
60 |
ExcelSavePath, |
61 |
BusinessPeriod, |
62 |
ConstructionYear, |
63 |
BusinessBeginningDate, |
64 |
ConstructionBeginningDate, |
65 |
ConstructionNoBase, |
66 |
SloganString1, |
67 |
SloganString2, |
68 |
SloganString3, |
69 |
EntryDate, |
70 |
UpdateDate |
71 |
FROM SystemMaster_OLD |
72 |
; |
73 |
commit; |
74 |
|