I am currently trying to do a bulk insert in a .sql file to insert .csv data into one of my SQL Server database's table. However, I need to be able to load the .csv file from its relative directory instead of using the full path. The .csv file is currently in the same directory as the .sql file.
I would like to do something like this
BULK INSERT team
FROM './FinalProject/teams.csv'
WITH
(
FORMAT = 'CSV',
FIELDQUOTE = '"',
FIRSTROW = 2,
FIELDTERMINATOR = ',', --CSV field delimiter
ROWTERMINATOR = '0x0a', --Use to shift the control to next row
TABLOCK
);
GO
but it cannot find the file.
How can I load the file without hardcoding its path?