0

I'm doing a very simple bulk insert:

CREATE EXTERNAL DATA SOURCE mysource WITH ( TYPE = BLOB_STORAGE, LOCATION = 'https://xxxxxxx.blob.core.windows.net/zzzz');

BULK INSERT mytable FROM 'myfile.csv' 
WITH (DATA_SOURCE = 'mysource',FORMAT='CSV',CODEPAGE = 65001,FIRSTROW = 2,TABLOCK,ROWTERMINATOR = '0x0a');

Which throws:

Msg 64, Level 20, State 0, Line 0 A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)

More information:

  • I'm using Microsoft SQL Server Management Studio 17.5
  • Database is in Azure
  • Storage is in Azure, and the blob has public access
  • The current count in mytable is large: 3942767

myfile.csv contains only 2 rows:

id,rbd,run,foo
"aaaabbbbb",4,0,5

In the past, this arrangement (storage + bulk insert) worked OK. Maybe this is happenning because the table is too large?

Notice:

This question has been identified as a possible duplicate of this: A transport-level error has occurred when receiving results from the server - well, they are very different. This is happening from SSMS directly sending the command to SQL Server. In that post, he is using a .NET application. Also this is happening exclusively with BULK INSERT. Normal inserts work fine.

sports
  • 7,851
  • 14
  • 72
  • 129
  • Possible duplicate of [A transport-level error has occurred when receiving results from the server](https://stackoverflow.com/questions/2962927/a-transport-level-error-has-occurred-when-receiving-results-from-the-server) – Amira Bedhiafi Aug 22 '19 at 14:18
  • Its not a duplicated. Its not even similar. That person is getting the error from an application: "It's a .Net 4.0 web application." - I'm getting it directly from the SQL Server through SSMS – sports Aug 22 '19 at 14:20
  • Although your question may come from a different scenario, have you ruled out that any of the answers in the suggested duplicate would fix your problem? Because yeah, the root cause should be the same in both cases. It's a network issue. – Tab Alleman Aug 22 '19 at 15:30
  • They dont work... – sports Aug 22 '19 at 16:13

0 Answers0