This commit is contained in:
2026-08-27 10:11:52 +01:00
parent 8d45a2505b
commit b42127c173
+13 -20
View File
@@ -1,25 +1,18 @@
# README
# python-mssql-interaction
## requirements
Demo project showing how to interact with SQL Server from Python using `pyodbc`.
python 3.13 or something
mssql server
install pip install pyodbc
check if odbc 17 (or other version)
on windows search for odbc data sources.
go to the menu point drivers.
There should odbc driver 17 for mssql server or something like that
## common pitfalls
always close connections
use with statement (preferred) or try -> finally
sql injections
use parameterized queries
poor exception handling
log errors, use finally blocks, use tx, use AD
## Structure
| Folder | Purpose |
|---|---|
| `basic-sql-server-interactions-and-dml/` | Connecting, running queries, and CRUD operations (INSERT, UPDATE, DELETE, SELECT) with and without parameters |
| `stored-procedures/` | Creating and calling stored procedures with and without output parameters |
| `functions/` | Creating and calling user-defined functions and built-in system functions |
| `advanced-topics/` | Bulk inserts from CSV, executing `.sql` scripts via PowerShell, CSV-to-table inserts, and a basic Tkinter TUI |
## Requirements
- Python 3.13+
- SQL Server with ODBC Driver 17
- `pip install -r requirements.txt`