Feb-13-2018, 02:27 PM
Hi Everyone!
I try to connect Python with SQL Server (with Windows Authentication), but I have a problem with the output... The code is:
Thanks very much for the help!
Regards Carlos,
I try to connect Python with SQL Server (with Windows Authentication), but I have a problem with the output... The code is:
import pypyodbc import pyodbc cnxn = pyodbc.connect('driver={SQL Server};server=ABC123;database=DB1;trusted_connection=true') cursor = cnxn.cursor() query = "SELECT TOP 10 * FROM TABLE_EXAMPLE " cursor.execute(query) cnxn.commit() cnxn.close()The error is:
cursor.execute(query) Out[298]: <pyodbc.Cursor at 0xe461623030>... someone knows what happens please?. I have Microsoft SQL Server 2014 and Python 3.6.1 | Anaconda 4.4.0
Thanks very much for the help!
Regards Carlos,