Step-by-Step: Loading CSV Bible Data into MS SQL Server

This article is part of my Bible Dashboard project, where I am documenting my journey of building a Bible dashboard using SQL Server and Power BI.

In this step, I loaded a public-domain King James Version Bible CSV file into Microsoft SQL Server. This helped me practice importing CSV data, checking data types, handling text issues, and preparing the dataset for future dashboard development.


Bible Dashboard Journey

  • Episode 1 – Finding the Right Bible Dataset
  • Episode 2 – Loading CSV Bible Data into SQL Server
  • Episode 3 – Cleaning the Bible Dataset
  • Episode 4 – Designing a Relational Bible Database
  • Episode 5 – Building the First Power BI Dashboard

Project Goal

The goal of this step was to import the KJV Bible CSV file into SQL Server so I could begin exploring the data with SQL queries and later connect it to Power BI.

The CSV file included columns such as:

  • Verse ID
  • Book Name
  • Book Number
  • Chapter
  • Verse
  • Text

Step 1: Review the CSV File

Before importing the data, I opened the CSV file to review the structure. I checked the column names, verse text, book names, chapter numbers, and verse numbers.

I also noticed that some verses included a paragraph marker symbol, such as:

¶ In the beginning God created the heaven and the earth.

This symbol was not an error. It was a paragraph marker included in the dataset. However, when opened with the wrong encoding in Excel, it appeared as an unusual symbol such as:

¶

This helped me learn that encoding issues are common when working with real-world CSV files.


Step 2: Create a SQL Server Table

Next, I created a table in SQL Server to store the Bible verse data.

CREATE TABLE Bible_KJV (
    VerseID INT,
    BookName NVARCHAR(100),
    BookNumber INT,
    Chapter INT,
    Verse INT,
    Text NVARCHAR(MAX)
);

I used NVARCHAR(MAX) for the verse text because Bible verses can vary in length, and I wanted to avoid truncation issues during import.


Step 3: Import the CSV File

After creating the table, I used SQL Server tools to import the CSV file into the database.

During the import process, I checked:

  • Column mappings
  • Data types
  • Text encoding
  • Whether the verse text was imported completely

This step reminded me that importing data is not only about loading a file. It is also about checking whether the data was loaded correctly.


Step 4: Check the Imported Data

After importing the data, I ran a simple query to confirm that the records were loaded successfully.

SELECT TOP 20 *
FROM Bible_KJV;

I checked the first few rows to make sure the book name, chapter, verse number, and text appeared correctly.


Step 5: Identify Data Cleaning Needs

While reviewing the imported data, I noticed that the paragraph marker could be useful as a feature. Instead of simply deleting it right away, I considered keeping track of whether a verse begins a new paragraph.

A future cleaning step could create a new column such as:

IsNewParagraph

Then the paragraph marker could be removed from the clean verse text while still preserving the information.


Possible Cleaning Query

If I decide to remove the paragraph marker from the verse text, I can use a query like this:

UPDATE Bible_KJV
SET Text = REPLACE(Text, N'¶', '');

However, before removing it permanently, I want to decide whether it should become part of the data model.


What I Learned

  • CSV files should be reviewed before importing.
  • Text encoding can affect how characters appear in Excel and SQL Server.
  • NVARCHAR(MAX) is useful for long text fields.
  • Unexpected symbols may contain useful information.
  • Data cleaning decisions should be made carefully before removing information.

Skills Practiced

  • SQL Server table creation
  • CSV import
  • Data type selection
  • Unicode and encoding awareness
  • Data validation
  • Early-stage database design thinking

Next Step

Now that the Bible CSV data has been loaded into SQL Server, the next step is to clean the dataset and begin designing a relational database.

Instead of keeping everything in one large table, I plan to separate the data into cleaner tables such as Books, Chapters, and Verses. This will make the database easier to query and better prepared for Power BI.

This project is still in progress, and I will continue documenting each step as I build the Bible Dashboard.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top