Import from CSV into matching table

PHOTO EMBED

Fri Sep 23 2022 21:40:49 GMT+0000 (UTC)

Saved by @dhfinch #sql #sqlserver

BULK INSERT ManualImport
FROM 'C:\temp\Second_Data-2022-09-15.csv'
WITH
(
    FIRSTROW = 2, -- as 1st one is header
    FIELDTERMINATOR = ',',  --CSV field delimiter
    ROWTERMINATOR = '\n',   --Use to shift the control to next row
    TABLOCK
)

SELECT MIN(DT) as MinDate, MAX(DT) as MaxDate, Count(DT) as [RowCount]
FROM ManualImport
content_copyCOPY