импорт pyms sql
def database_connect ():
connection = pymssql.connect(host='XXXXXXX',
user='XXXXXXXX',
password='XXXXXXXXXXXXXXX',
database='XXXXXXXX',
port=default,
connect_timeout=600)
cursor = connection.cursor ()
cursor.execute ("ВЫБРАТЬ ВЕРСИЮ () ")
data = cursor.fetchone ()
print (" Версия базы данных:% s "% данных)
connection.close ()