I need to import an CSV File into SQL.
The following BULK sql query works fine in ssms.
It always fails when I try to run it in Power Automate.
Power automate creates my "bildlitste" table and my other sql code works fine in power automate.
Only the BULK INSERT gets me an error. Rest of sql code works fine
Here is my sql code:
BULK INSERT bildliste
FROM 'C:\Users\Administrator\Downloads\bilderliste.csv'
WITH
(
FIRSTROW = 2, -- as 1st one is header
FIELDTERMINATOR = ',', --CSV field delimiter
ROWTERMINATOR = '\n', --Use to shift the control to next row
TABLOCK
)
Error:
Error in SQL statement Cannot bulk load becaue the file "C:\Users\Administrator\Downloads\bilderliste.csv" could not be opened. Operating system error
Thank you for your help!
Solved! Go to Solution.
Hi @10101
I'm not sure but can you try removing the comments from the query just in case it is not interpreting them properly (eg; -- as 1st one is header).
Also if you can do some web search on the error message that can give you some direction.
Hi @10101
I'm not sure but can you try removing the comments from the query just in case it is not interpreting them properly (eg; -- as 1st one is header).
Also if you can do some web search on the error message that can give you some direction.
Anyone having trouble with this can also try this batch SQL CRUD template: