i have C# WinForm program that i need to insert fast big data to sql-server.
The sql-server is in cloude server, and the file that i load in local computer.
the file is Text (Tab delimited) in
d:\TEST\TEST.txt and has Full permissions
BAR DES MAK
111 aaa 222
333 bbb 333
.
.
the sql-server table is CatTbl:
BAR nvarchar(250)
DES nvarchar(250)
MAK nvarchar(250)
i try to insert like this:
SQL = @"BULK INSERT CatTbl FROM 'd:\TEST\TEST.txt' WITH (CODEPAGE=1255,FIELDTERMINATOR = '\t')";
Cmd = new SqlCommand(SQL, Conn);
Cmd.ExecuteNonQuery();
Cmd.Dispose();
when i work on local sql-server its works excellent.
but in cloude sql-server i got error:
Cannot bulk load because the file "d:\TEST\TEST.txt" could not be opened. Operating system error code 21(The device is not ready.).
Please note that the sql-server connection is successful
I searched the web and found no answer that solved the problem. I would appreciate some help
What I have tried:
SQL = @"BULK INSERT CatTbl FROM 'd:\TEST\TEST.txt' WITH (CODEPAGE=1255,FIELDTERMINATOR = '\t')";
Cmd = new SqlCommand(SQL, Conn);
Cmd.ExecuteNonQuery();
Cmd.Dispose();