Click here to Skip to main content
15,884,074 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,


I have a attachment in DB. I stored a file(.exe) in a table Varbinary Column. When I try to retrieve the row, the below message will come. Please help me.


Msg 10054, Level 20, State 0, Line 0
A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)



Out of .exe like .jpg,.jpeg,etc I have able to retrieve
Posted

1 solution

There is no one single solution to this.
Start here: http://blogs.msdn.com/b/spike/archive/2009/04/16/a-transport-level-error-has-occurred-when-sending-the-request-to-the-server-provider-tcp-provider-error-0-an-existing-connection-was-forcibly-closed-by-the-remote-host.aspx[^] - it may help.

Also, check how big the EXE binary is, if it is seriously huge then it is vaguely possible that SQL is just timing out the request waiting for the data. It's also worth checking your query, and making sure that it is only returning a single file, rather than every file in the DB...
 
Share this answer
 
Comments
Member 11199965 3-Nov-14 1:25am    
HI,

I can't able to select that particular record. So help me how to check that binary size is big or not?
OriginalGriff 3-Nov-14 3:15am    
Why can't you select that record? How are you trying?
Have you tries using DATALENGTH?

http://msdn.microsoft.com/en-us/library/ms173486.aspx
Member 11199965 3-Nov-14 3:58am    
Hi,

When I tried to find the datalength for the particular rows, the below error message is displayed. Please help me.

FILESTREAM file named with GUID '%.*ls' that belongs to FILESTREAM data file ID 0x%x does not exist or cannot be opened.
OriginalGriff 3-Nov-14 5:43am    
What is your table definition?
Member 11199965 3-Nov-14 6:05am    
Please find the below is the table properties. Kindly help me.


Column_name Type Computed Length Prec Scale Nullable TrimTrailingBlanks FixedLenNullInSource Collation
attachment_id bigint no 8 19 0 no (n/a) (n/a) NULL
attachment varbinary no -1 yes no yes NULL
attachment_name nvarchar no 2000 yes (n/a) (n/a) SQL_Latin1_General_CP1_CI_AS
attachment_type nvarchar no 200 yes (n/a) (n/a) SQL_Latin1_General_CP1_CI_AS

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900