Sqlserver
 sql >> Base de Dados >  >> RDS >> Sqlserver

Conectando o python 3.3 ao microsoft sql server 2008


Vou aumentar a resposta de mata com um exemplo pypyodbc.
import pypyodbc
connection_string ='Driver={SQL Server Native Client 11.0};Server=<YOURSERVER>;Database=<YOURDATABASE>;Uid=<YOURUSER>;Pwd=<YOURPASSWORD>;'
connection = pypyodbc.connect(connection_string)
SQL = 'SELECT * FROM <YOURTABLE>'

cur = connection.cursor()
cur.execute(SQL)

cur.close()
connection.close()