I want to use a Bulk Insert function to upload the data from two different tabs in the same .xlsx
file.
I created an empty table with column names that match the table from the first tab in the Excel file. In the Bulk Insert section, I then use the file path to access the Excel file. I feel like I’m missing one line of code that will instruct SQL which Excel tab to pull (let’s call if GotvShiftsTab):
DROP TABLE #GotvShifts
CREATE TABLE #GotvShifts (
VANID varchar(100),
contact_name varchar(100),
signup_date varchar(100),
status_ varchar(100),
role_ varchar(100),
event_name varchar(100),
event_type varchar(100),
event_date varchar(100),
shift_start_time varchar(100),
shift_end_time varchar(100),
location_name varchar(100),
recruited_by varchar(100))
BULK INSERT #GotvShifts
FROM 'na2-fs1DCDATA6CasesActive47758 – Meza v CotyTeam Member FoldersASdata_exam_q1_datasets.xlsx'
WITH (FIRSTROW = 2,Rowterminator='n')