You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- If you don't already have `uv`, install `uv` by following the instructions from [https://docs.astral.sh/uv/getting-started/installation/](https://docs.astral.sh/uv/getting-started/installation/).
40
44
41
45
- A database on SQL Server, Azure SQL Database, or SQL database in Fabric with the [!INCLUDE [sssampledbobject-md](../../../includes/sssampledbobject-md.md)] sample schema and a valid connection string.
@@ -44,37 +48,37 @@ The `mssql-python` driver doesn't require any external dependencies on Windows m
@@ -119,7 +123,7 @@ This quickstart requires the *[!INCLUDE [sssampledbnormal-md](../../../includes/
119
123
120
124
1. Create a new [project](https://docs.astral.sh/uv/guides/projects/#project-structure) with `uv`.
121
125
122
-
```bash
126
+
```console
123
127
uv init jupyter-notebook-qs
124
128
cd jupyter-notebook-qs
125
129
```
@@ -128,7 +132,7 @@ This quickstart requires the *[!INCLUDE [sssampledbnormal-md](../../../includes/
128
132
129
133
In the same directory, install the `mssql-python`, `python-dotenv`, `rich`, `pandas`, and `matplotlib` packages. Then add `ipykernel` and `uv` as dev dependencies. VS Code requires `ipykernel` and `uv` are added to be able to interact with `uv` from within your notebook cells using commands like `!uv add mssql_python`.
130
134
131
-
```bash
135
+
```console
132
136
uv add mssql_python dotenv rich pandas matplotlib
133
137
uv add --dev ipykernel
134
138
uv add --dev uv
@@ -138,7 +142,7 @@ uv add --dev uv
138
142
139
143
In the same directory, run the following command.
140
144
141
-
```bash
145
+
```console
142
146
code .
143
147
```
144
148
@@ -284,6 +288,9 @@ code .
284
288
Console().print(table)
285
289
```
286
290
291
+
> [!TIP]
292
+
> To use Microsoft Entra Authentication in macOS, you must be signed in via either the [Azure Repos](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-repos) extension in Visual Studio Code, or by running `az login` via the [Azure Command-Line Interface (CLI)](/cli/azure/install-azure-cli).
293
+
287
294
1. Use the **Run All** button at the top of the notebook to run the notebook.
288
295
289
296
1. Select the **jupyter-notebook-qs** kernel when prompted.
Copy file name to clipboardExpand all lines: docs/connect/python/mssql-python/python-sql-driver-mssql-python-quickstart.md
+20-13Lines changed: 20 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: This quickstart describes installing Python, and mssql-python then
4
4
author: dlevy-msft-sql
5
5
ms.author: dlevy
6
6
ms.reviewer: vanto, randolphwest
7
-
ms.date: 10/06/2025
7
+
ms.date: 10/30/2025
8
8
ms.service: sql
9
9
ms.subservice: connectivity
10
10
ms.topic: quickstart-sdk
@@ -16,7 +16,9 @@ ms.custom:
16
16
17
17
In this quickstart, you connect a Python script to a database that you created and loaded with sample data. You use the `mssql-python` driver for Python to connect to your database and perform basic operations, like reading and writing data.
The `mssql-python` driver doesn't require any external dependencies on Windows machines. The driver installs everything that it needs with a single `pip` install, allowing you to use the latest version of the driver for new scripts without breaking other scripts that you don't have time to upgrade and test.
- A database on SQL Server, Azure SQL Database, or SQL database in Fabric with the [!INCLUDE [sssampledbobject-md](../../../includes/sssampledbobject-md.md)] sample schema and a valid connection string.
32
36
33
37
## Setup
@@ -47,48 +51,48 @@ Get the [`mssql-python` package](https://pypi.org/project/mssql-python/) from Py
@@ -101,7 +105,7 @@ Get the [`python-dotenv`](https://pypi.org/project/python-dotenv/) from PyPI.
101
105
102
106
1. In the same directory, install the `python-dotenv` package.
103
107
104
-
```bash
108
+
```console
105
109
pip install python-dotenv
106
110
```
107
111
@@ -111,7 +115,7 @@ You can use the PyPI command-line tool to verify that your intended packages are
111
115
112
116
1. Check the list of installed packages with `pip list`.
113
117
114
-
```bash
118
+
```console
115
119
pip list
116
120
```
117
121
@@ -224,9 +228,12 @@ Use a SQL query string to execute a query and parse the results.
224
228
225
229
1.**Save** the `app.py` file.
226
230
231
+
> [!TIP]
232
+
> To use Microsoft Entra Authentication in macOS, you need to be logged in by running `az login` via the [Azure Command-Line Interface (CLI)](/cli/azure/install-azure-cli).
233
+
227
234
1. Open a terminal and test the application.
228
235
229
-
```bash
236
+
```console
230
237
python app.py
231
238
```
232
239
@@ -308,7 +315,7 @@ Execute an [INSERT](../../../t-sql/statements/insert-transact-sql.md) statement
308
315
309
316
1.**Save** the `app.py` file and test the application again.
Copy file name to clipboardExpand all lines: docs/connect/python/mssql-python/python-sql-driver-mssql-python-rapid-prototyping-quickstart.md
+31-11Lines changed: 31 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: This quickstart describes creating prototypes reports quickly using
4
4
author: dlevy-msft-sql
5
5
ms.author: dlevy
6
6
ms.reviewer: vanto, randolphwest
7
-
ms.date: 10/06/2025
7
+
ms.date: 10/30/2025
8
8
ms.service: sql
9
9
ms.subservice: connectivity
10
10
ms.topic: quickstart-sdk
@@ -18,7 +18,7 @@ In this quickstart, you use [`Streamlit`](https://streamlit.io/) to quickly crea
18
18
19
19
The `mssql-python` driver doesn't require any external dependencies on Windows machines. The driver installs everything that it needs with a single `pip` install, allowing you to use the latest version of the driver for new scripts without breaking other scripts that you don't have time to upgrade and test.
- If you don't already have `uv`, install `uv` by following the instructions from [https://docs.astral.sh/uv/getting-started/installation/](https://docs.astral.sh/uv/getting-started/installation/).
34
42
- A database on SQL Server, Azure SQL Database, or SQL database in Fabric with the [!INCLUDE [sssampledbobject-md](../../../includes/sssampledbobject-md.md)] sample schema and a valid connection string.
35
43
- Install one-time operating system specific prerequisites.
@@ -98,6 +106,7 @@ This quickstart requires the *[!INCLUDE [sssampledbnormal-md](../../../includes/
98
106
99
107
-[Create a new project](#create-a-new-project)
100
108
-[Add dependencies](#add-dependencies)
109
+
-[Launch Visual Studio Code](#launch-visual-studio-code)
101
110
-[Update pyproject.toml](#update-pyprojecttoml)
102
111
-[Update main.py](#update-mainpy)
103
112
-[Save the connection string](#save-the-connection-string)
@@ -109,7 +118,7 @@ This quickstart requires the *[!INCLUDE [sssampledbnormal-md](../../../includes/
109
118
110
119
1. Create a new [project](https://docs.astral.sh/uv/guides/projects/#project-structure) with `uv`.
111
120
112
-
```bash
121
+
```console
113
122
uv init rapid-prototyping-qs
114
123
cd rapid-prototyping-qs
115
124
```
@@ -118,10 +127,18 @@ This quickstart requires the *[!INCLUDE [sssampledbnormal-md](../../../includes/
118
127
119
128
In the same directory, install the `mssql-python`, `streamlit`, and `python-dotenv` packages.
120
129
121
-
```bash
130
+
```console
122
131
uv add mssql-python python-dotenv streamlit
123
132
```
124
133
134
+
### Launch Visual Studio Code
135
+
136
+
In the same directory, run the following command.
137
+
138
+
```console
139
+
code .
140
+
```
141
+
125
142
### Update pyproject.toml
126
143
127
144
1. The [pyproject.toml](https://docs.astral.sh/uv/concepts/projects/layout/#the-pyprojecttoml) contains the metadata for your project. Open the file in your favorite editor.
> To use Microsoft Entra Authentication in macOS, you need to be logged in via either the [Azure Repos](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-repos) extension in Visual Studio Code or by running `az login` via the [Azure Command-Line Interface (CLI)](/cli/azure/install-azure-cli).
295
+
276
296
1. In the terminal window from before, or a new terminal window open to the same directory, run the following command.
0 commit comments