Loading the 2018 VAERS CSV Datasets Into SQL Server

Loading the 2018 VAERS CSV Datasets Into SQL Server

To quickly view the CSV files, you can always open them into a spreadsheet.

To load the 2018 CSV files into SQL Server, follow much the same procedure for 2019.

First create a SQL Server database for 2018, called:
vaers_2018

The zipped SQL scripts may be found here.
The zip file is about 12 mb.

Primary Key:
Add a primary key to 2018VAERSDATA:

use vaers_2018;
go

alter table
dbo.[2018VAERSDATA]
add constraint pk_2018VAERSDATA
primary key
( vaers_id ) ;
go

 

Quick Query:
Do a quick query to make sure the data loaded

use vaers_2018;
go

select
min (vaers_id) min_vaers_id
, max (vaers_id) max_vaers_id
, count(*) count
from dbo.[2018VAERSDATA];
go

 

min_vaers_idmax_vaers_idcount
73221784438049166

Duplicate Rows:

As with 2019 CSV files, there will be some duplicate rows in 2018VAERSSYMPTOMS, and 2018VAERSVAX.

Thus the difficulty of adding primary keys.  This will be a subject for another blog post.

Leave a Reply

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