Giter Club home page Giter Club logo

cbtsqltraining's Introduction

Getting Started

This is the readme file for running the script to make mass insert into the db! Here's how to set up your development environment and run the code.

Prerequisites:

  • A computer with a working internet connection.
  • Run the script in the script.sql in your sql server scripts (copy/paste)

Software Installations:

  1. Python: Download and install Python from the official website: https://www.python.org/. Choose the appropriate installer for your operating system (Windows, macOS, or Linux). Follow the on-screen instructions to complete the installation.

Setting Up the Project Environment:

  1. Open your project folder:

    • Using File Explorer (Windows) or Finder (Mac):

      i. Locate the folder containing the project files on your computer. ii. Right-click on the folder. iii. Select the option that opens the folder in your terminal/command prompt (e.g., "Open in Terminal" on macOS or "Open in Command Prompt" or "Open in PowerShell" on Windows). This will launch your terminal and automatically set the current working directory to the project folder.

  2. Create and Activate Virtual Environment:

    a. Windows:

    i. In the terminal window (launched from Step 1), you're already in the project directory. Use the following command to create a virtual environment named my_env (replace with your preferred name):

    ```bash
    python -m venv my_env
    ```
    

    ii. Activate the virtual environment:

    ```bash
    my_env\Scripts\activate
    ```
    

    b. macOS/Linux:

    i. In the terminal window (launched from Step 1), you're already in the project directory. Use the following command to create a virtual environment named my_env (replace with your preferred name):

    ```bash
    python -m venv my_env
    ```
    

    ii. Activate the virtual environment:

    ```bash
    source my_env/bin/activate
    ```
    

    Note: The prompt will change to indicate you're now working within the virtual environment (e.g., (my_env)user@machine:~$).

  3. Install Required Dependencies:

    • The project dependencies are listed in a file named requirements.txt. Install them using:

      pip install -r requirements.txt

Setup Database server to connect with Python:

  1. ODBC Adapter (if connecting to SQL Server):

  2. Create SQL Server Credentials (if applicable):

  3. Create .env:

    • Create a file named .env in the project directory (important: exclude this file from version control!).

    • Add the following lines, replacing placeholders with your database information:

      #SQL_SERVER=MSSQLSERVER
      SQL_SERVER=YOUR_SERVER_NAME
      SQL_DATABASE=YOUR_DATABASE_NAME
      SQL_USERNAME=YOUR_USERNAME
      SQL_PASSWORD=YOUR_PASSWORD
      

Running the Code:

  1. Ensure your virtual environment is activated (refer to step 2a or 2b for activation commands).

  2. Execute the main Python file:

    python main.py

Additional Notes:

  • If you encounter any issues during the setup process, feel free to consult online resources or ask for help during class.
  • Remember to replace placeholders with your actual information when setting up database credentials (if applicable).
  • To deactivate the virtual environment, simply type deactivate in your terminal.

cbtsqltraining's People

Contributors

bencipher avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.