connect to ssms with python

Solutions on MaxInterview for connect to ssms with python by the best coders in the world

showing results for - "connect to ssms with python"
Andrés
16 May 2016
1import pyodbc 
2conn = pyodbc.connect('Driver={SQL Server};'
3                      'Server=server_name;'
4                      'Database=database_name;'
5                      'Trusted_Connection=yes;')
6
7cursor = conn.cursor()
8cursor.execute('SELECT * FROM database_name.table')
9
10for row in cursor:
11    print(row)
12
queries leading to this page
python in ssmsconnect to ssms with python