I am trying to connect to azure sql database through Jupyter notebook and later to load the data into excel/csv .I have the details of server and database only .Username & password i think by default its taking my desktop credentials(unsure).
Here is tried code
import pyodbc
cnxn = pyodbc.connect(Server=myserver;Database=mydatabase)
2
Answers
In order to connect to your Azure SQL database with your jupyter notebook use the following:
For more details you can refer to the following links:
You need to give username, password of the Azure SQL database in connextion. Below is the code to establish connection of Azure SQl database using python in Jupyter Notebook.
Reference: Use Python to query a database – Azure SQL Database & SQL Managed Instance | Microsoft Learn