import pyodbc
connection_string = ("DRIVER={##########};"
"SERVER=############;"
"DATEBASE=#############"
"UID=############;"
"PWD=#########"
)
cnxn = pyodbc.connect(connection_string)
cursor = cnxn.cursor()
query = "sp_help '<tablename>';"
cursor.execute(query)
result1= cursor.fetchone()
print (result1)
cnxn.close()
When I execute the above from python I get this as output:
('XX_SAMPLE', 'dbo', 'user table', datetime.datetime(2022, 2, 15, 10, 43, 57, 610000))
but when I execute the same query from the SSMS I get :
so, is there any way to store rest all data that is displayed in SSMS if I run it from python