How to maintain the connection to the Sql for a long period

1

My application does select in the A table of server 1 and with the result of select a insert is done in table B 2 server with query data. The routine works for a certain time, then I have this exception:

  

System.Data.SqlClient.SqlException (0x80131904): The transport-level error has occurred when receiving results from the server. (provider: Session Provider, error: 19 - Physical connection is not usable)

Query results rotate around 50k of lines to 96K (but there is a case of more than 990k of lines), when it reaches around 20k this exception occurs. Is it a connection error or a Sql exception?

    
asked by anonymous 19.10.2016 / 20:06

1 answer

1

I only saw this once, and it was when I was working on a very slutty network, with the wifi dropping all the time.

Switching to the cable helped me, but in your case, if there is no permission, I recommend optimizing the query, or doing it asynchronously if there is no other option.

    
19.10.2016 / 20:33