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

I want to extract 3,00,000 of blob data using some .net utility. I have done one sample utility using C#.net, but its taking huge time to extract all the data. Its taking more that 10Hrs. Pls help to solve this issue.

Thanks,
Senthil
Posted
Updated 20-Oct-11 3:04am
v2
Comments
Mehdi Gholam 20-Oct-11 8:58am    
What code are you using?
sachin10d 20-Oct-11 9:03am    
check query output time required in sql server first.
Sazzad Hossain 20-Oct-11 9:06am    
what version of SQL server r u using?
senthil sennu 20-Oct-11 9:07am    
using SqlDataReader i am Reading the blob as BYTE and using FileStream ,BinaryWriter i am writing a blob as file.


Sql Version - 2008

Without relevant code fragments it is not possible to be exact. However, my guess is that you are reading all the records from the database and then just using the one you are interested in - there is no way that a single 3Mb query should take over ten hours unless you are using semaphore instead of network cable.
Check you SELECT query: make sure that the WHERE clause restricts the returned records to just the one you are interested in. And make sure that it returns only the columns you are going to use: do not use SELECT * FROM ....
If you aren't sure, modify your SELECT to return only small fields (not the BLOB field) and see how many it returns.
 
Share this answer
 
Found something on CP discussed on long ago: Performance-tip-on-extracting-BLOB-from-database.aspx[^]

Also some pros and cons of doing BLOBS http://devtoolshed.com/content/c-storeretrieve-file-database-image-field-using-odbc[^]

I personally would only store the string paths of files in the DB rather than storing the bulky files in bytes and read that path to manipulate the files.
 
Share this answer
 

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