I would need to insert with VBA code a lot of rows into a table. I have a local tab-separated text file (C:\MyFile.txt) that I print from Excel and would need to upload the data in it into my SQL server table "MyTable". I tried with:
BULK Insert MyTable FROM 'C:\MyFile.txt' WITH(FIELDTERMINATOR = '\t',ROWTERMINATOR = '\n')
but it insists c:\MyFile.txt doesn't exist (I'm sure it does).
How am I supposed to refer to c:\MyFile.txt? With MySQL this worked easily using LOAD INFILE.
The C:\MyFile.txt refers to the C: Drive on the Server where MS SQL Server is. Not your local drive.
Any way to make it refer to my local drive? Or is there any other options? I would prefer not to make hundreds of individual "INSERT INTO"-statements, but is that the only option?