Overview: This project demonstrates how to interact with a SQL Server database using Python. It includes a Python class, SQLServerDB, that handles the database connections and CRUD operations. The class allows the user to create, read, update, and delete records in the "Customers" table of the specified SQL Server database. User input is used to drive the CRUD operations, making it interactive and versatile for working with various data.
Features:
- Establishing a connection to SQL Server using pyodbc.
- Implementing CRUD operations (Create, Read, Update, Delete) with user input.
- Providing error handling for robustness.
- Demonstrating database interaction in a Python project.
Install Required Libraries before running code:
Ensure you have pyodbc
installed. You can install it using pip in terminal:
pip install pyodbc