| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
Python sample code that runs on an Windowsclient computer to connect to an Azure SQL Database using the pyodbc connector.
About this sample
Before you begin
Run this sample
Sample details
Disclaimers
Related links
To run this sample, you need the following prerequisites.
Software prerequisites:
SQL Server 2016 (or higher) or an Azure SQL Database
Python
Microsoft ODBC Driver 11 or 13 for SQL Server Windows
pip install pyodbc
Note: Instructions to enable the use pip can be found here
Azure prerequisites:
An AdventureWorks sample database:
From your terminal, update the connection string details in the Python file with your own username, password, and hostname.
Run the code sample by running the below in your terminal:
python sample_python_windows.py
The above sample code just connected to your AdventureWorks database and performed a SELECT statement and an INSERT statement.
The scripts and this guide are copyright Microsoft Corporations and are provided as samples. They are not part of any Azure service and are not covered by any SLA or other Azure-related agreements. They are provided as-is with no warranties express or implied. Microsoft takes no responsibility for the use of the scripts or the accuracy of this document. Familiarize yourself with the scripts before using them.
| Back | FazBrowse Home | New Git URL |