mssql_script21.py 796 Bytes
import pyodbc

hil_sql = """
    create table interface_report
    (
       id bigint identity primary key,
       source nvarchar(64) not null,
       target nvarchar(64) not null,
       body nvarchar(max),
       response nvarchar(max),
       status bit default 1 not null,
       retry_times tinyint default 0 not null,
       duration smallint not null,
       create_time datetime not null
    );
"""

afc_sql = """

"""

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()