mssql_script7.py
5.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import pyodbc
hil_sql = """
ALTER TABLE hil_ca_compare_result ADD version nvarchar(8), comments nvarchar(max);
ALTER TABLE hil_se_compare_result ADD version nvarchar(8), comments nvarchar(max);
create table hil_se_compare_result_record
(
id int identity primary key,
application_id nvarchar(64) not null,
is_finish bit default 0 not null,
compare_count smallint default 0 not null,
failed_count smallint default 0 not null,
reason1_count smallint default 0 not null,
reason2_count smallint default 0 not null,
reason3_count smallint default 0 not null,
reason4_count smallint default 0 not null,
reason5_count smallint default 0 not null,
reason6_count smallint default 0 not null,
reason7_count smallint default 0 not null,
reason8_count smallint default 0 not null,
reason9_count smallint default 0 not null,
reason10_count smallint default 0 not null,
result nvarchar(max),
comments nvarchar(max),
create_time datetime not null
);
create index hil_se_compare_result_record_application_id_index
on hil_se_compare_result_record (application_id);
create index hil_se_compare_result_record_create_time_index
on hil_se_compare_result_record (create_time);
create table hil_ca_compare_result_record
(
id int identity primary key,
application_id nvarchar(64) not null,
is_finish bit default 0 not null,
compare_count smallint default 0 not null,
failed_count smallint default 0 not null,
reason1_count smallint default 0 not null,
reason2_count smallint default 0 not null,
reason3_count smallint default 0 not null,
reason4_count smallint default 0 not null,
reason5_count smallint default 0 not null,
reason6_count smallint default 0 not null,
reason7_count smallint default 0 not null,
reason8_count smallint default 0 not null,
reason9_count smallint default 0 not null,
reason10_count smallint default 0 not null,
result nvarchar(max),
comments nvarchar(max),
create_time datetime not null
);
create index hil_ca_compare_result_record_application_id_index
on hil_ca_compare_result_record (application_id);
create index hil_ca_compare_result_record_create_time_index
on hil_ca_compare_result_record (create_time);
"""
afc_sql = """
ALTER TABLE afc_ca_compare_result ADD version nvarchar(8), comments nvarchar(max);
ALTER TABLE afc_se_compare_result ADD version nvarchar(8), comments nvarchar(max);
create table afc_se_compare_result_record
(
id int identity primary key,
application_id nvarchar(64) not null,
is_finish bit default 0 not null,
compare_count smallint default 0 not null,
failed_count smallint default 0 not null,
reason1_count smallint default 0 not null,
reason2_count smallint default 0 not null,
reason3_count smallint default 0 not null,
reason4_count smallint default 0 not null,
reason5_count smallint default 0 not null,
reason6_count smallint default 0 not null,
reason7_count smallint default 0 not null,
reason8_count smallint default 0 not null,
reason9_count smallint default 0 not null,
reason10_count smallint default 0 not null,
result nvarchar(max),
comments nvarchar(max),
create_time datetime not null
);
create index afc_se_compare_result_record_application_id_index
on afc_se_compare_result_record (application_id);
create index afc_se_compare_result_record_create_time_index
on afc_se_compare_result_record (create_time);
create table afc_ca_compare_result_record
(
id int identity primary key,
application_id nvarchar(64) not null,
is_finish bit default 0 not null,
compare_count smallint default 0 not null,
failed_count smallint default 0 not null,
reason1_count smallint default 0 not null,
reason2_count smallint default 0 not null,
reason3_count smallint default 0 not null,
reason4_count smallint default 0 not null,
reason5_count smallint default 0 not null,
reason6_count smallint default 0 not null,
reason7_count smallint default 0 not null,
reason8_count smallint default 0 not null,
reason9_count smallint default 0 not null,
reason10_count smallint default 0 not null,
result nvarchar(max),
comments nvarchar(max),
create_time datetime not null
);
create index afc_ca_compare_result_record_application_id_index
on afc_ca_compare_result_record (application_id);
create index afc_ca_compare_result_record_create_time_index
on afc_ca_compare_result_record (create_time);
"""
hil_cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};', autocommit=True)
hil_cursor = hil_cnxn.cursor()
hil_cursor.execute(hil_sql)
hil_cursor.close()
hil_cnxn.close()
afc_cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};', autocommit=True)
afc_cursor = afc_cnxn.cursor()
afc_cursor.execute(afc_sql)
afc_cursor.close()
afc_cnxn.close()