mssql_script9.py
1.28 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
import pyodbc
afc_sql = """
create table afc_se_cms_info
(
id bigint identity primary key,
application_id nvarchar(64) not null,
content nvarchar(max) not null,
update_time datetime not null,
create_time datetime not null
);
create index afc_se_cms_info_application_id_index
on afc_se_cms_info (application_id);
create index afc_se_cms_info_create_time_index
on afc_se_cms_info (create_time);
"""
hil_sql = """
create table hil_se_cms_info
(
id bigint identity primary key,
application_id nvarchar(64) not null,
content nvarchar(max) not null,
update_time datetime not null,
create_time datetime not null
);
create index hil_se_cms_info_application_id_index
on hil_se_cms_info (application_id);
create index hil_se_cms_info_create_time_index
on hil_se_cms_info (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()