Is it possible to execute the bulk insert query in SQL Server with a buffer from Python (df.to_csv(buffer)
where buffer is a Pandas dataframe) instead of a file path:
bulk insert #temp
from 'file_path' -- instead of a file_path, use buffer?
with (
fieldterminator = ',',
rowterminator = '\n'
);
The only way I can think of doing this is to have Python make a CSV file and store it locally, and then have SQL execute a bulk insert via the file path. However, is there a way to do this without storing it locally, and rather directly in Python/SQL Server?