- Source data: AQS Pre-Generated Data Files page --> Daily Summary Data section --> Particulates table --> PM2.5 Speciation column --> "daily_SPEC_<YYYY>.zip"
- Local storage location:
\\VADER\SourceData\AQS\Data\CSN\R<YYYMMDD>
or \\VADER\SourceData\AQS\Data\CSN\Current
- Example command for transferring data from the source files:
SELECT * INTO EPAPM25SD_2017_R20170905
FROM OPENROWSET(
'MSDASQL',
'Driver={Microsoft Access Text Driver (*.txt, *.csv)};DEFAULTDIR=E:\SourceData\AQS\Data\CSN\R20170905\;Extensions=CSV;',
'SELECT * FROM daily_SPEC_2017.csv'
) -- (53,406 row(s) affected); took 6 seconds to complete
- Example command for creating the master working table:
-- Drop any master table(s) left over from a previous import attempt
IF OBJECT_ID('EPAPM25SD_1997_2017_R20170905') IS NOT NULL DROP TABLE EPAPM25SD_1997_2017_R20170905
SELECT
*
INTO EPAPM25SD_1997_2017_R20170905
FROM ( -- Use the UNION'd SELECT commands generated by the previous script here:
SELECT * FROM EPAPM25SD_1990_R20170112 UNION
SELECT * FROM EPAPM25SD_1991_R20170112 UNION
SELECT * FROM EPAPM25SD_1992_R20170112 UNION
SELECT * FROM EPAPM25SD_1993_R20170112 UNION
SELECT * FROM EPAPM25SD_1994_R20170112 UNION
SELECT * FROM EPAPM25SD_1995_R20170112 UNION
SELECT * FROM EPAPM25SD_1996_R20170112 UNION
SELECT * FROM EPAPM25SD_1997_R20170112 UNION
SELECT * FROM EPAPM25SD_1998_R20170112 UNION
SELECT * FROM EPAPM25SD_1999_R20170112 UNION
SELECT * FROM EPAPM25SD_2000_R20170112 UNION
SELECT * FROM EPAPM25SD_2001_R20170112 UNION
SELECT * FROM EPAPM25SD_2002_R20170112 UNION
SELECT * FROM EPAPM25SD_2003_R20170112 UNION
SELECT * FROM EPAPM25SD_2004_R20170112 UNION
SELECT * FROM EPAPM25SD_2005_R20170112 UNION
SELECT * FROM EPAPM25SD_2006_R20170112 UNION
SELECT * FROM EPAPM25SD_2007_R20170112 UNION
SELECT * FROM EPAPM25SD_2008_R20170112 UNION
SELECT * FROM EPAPM25SD_2009_R20170112 UNION
SELECT * FROM EPAPM25SD_2010_R20170112 UNION
SELECT * FROM EPAPM25SD_2011_R20170112 UNION
SELECT * FROM EPAPM25SD_2012_R20170112 UNION
SELECT * FROM EPAPM25SD_2013_R20170905 UNION
SELECT * FROM EPAPM25SD_2014_R20170905 UNION
SELECT * FROM EPAPM25SD_2015_R20170905 UNION
SELECT * FROM EPAPM25SD_2016_R20170905 UNION
SELECT * FROM EPAPM25SD_2017_R20170905
) T1
-- ^^ (41077009 row(s) affected); took 3:50 minutes
-- Visually inspect the top rows of the composite table
SELECT TOP 200 * FROM EPAPM25SD_1997_2017_R20170905
- Example Dataset registration command:
USE AIRDATA_CORE
GO
EXEC bspRegisterDataSetItem
@DatasetItemName='EPAPM25SD_1997_2017_R20170905',
@DataSetID=20002,
@ProtocolID=2006,
@RevisionNumber=1,
@SourceName='EPAPM25SD_1997_2017_R20170905',
@SourceAcquisitionDate='9/5/2017',
@RemoteDataUri='http://aqsdr1.epa.gov/aqsweb/aqstmp/airdata/download_files.html#Daily',
@LocalDataUri='\\VADER\E\SourceData\AQS\Data\CSN\R20170905',
@ImportFormat='Text Files',
@RegistrationComments='Re-import of the entire AQS CSN dataset'
- Example Dataset import command:
USE AIRDATA_IMPORT
GO
EXEC bspImportDatasetItem
@DataSetItemName='EPAPM25SD_1997_2017_R20170905',
@DestinationName='AirFact_EPAPM25SD_1997_2017_R20170905',
@ShowProgress=1,
@AbortOnSiteMappingError=0,
@AbortOnParameterMappingError=1,
@AbortOnMethodMappingError=1,
@AbortOnFlagMappingError=1,
@AbortOnUnitMappingError=1,
@KeepSource=1,
@KeepTempTables=1,
@UpdateStatistics=1,
@ImportedBy='SEM',
@ImportComments='Imported via stored procedure bspImportDatasetItem().',
@ArgKeys=NULL,
@ArgValues=NULL