Click here to Skip to main content
15,886,740 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Hi,
We are using BLOB to save files but now want to save filesystemobject to sql server.
Can you provide some help!
Posted
Comments
Kornfeld Eliyahu Peter 11-Jun-14 4:35am    
Look for object serialization...

1 solution

You can really approach this type of problem (storing files for later retrieval) one of two ways:

1. store a link in the database (easier up front, but you need a place to store the actual data)

2. store the blob right in the database (more complex up front, easier for migrations)

Since you mention storing a FSO into a BLOB - I assume you've settled on option #2.

FILESTREAM - http://technet.microsoft.com/en-us/library/bb933993%28v=sql.105%29.aspx[^] - allows you to stream files into and out of a MS SQL database - but you have to have MSSQL 2008 or above and adjust the SQL server to handle that functionality (i.e. your DBA may have to enable it, etc.).

Another way is highlighted in my article here:
Uploading and downloading files to/from a SQL Server database[^] - which involves streaming data in and out of varbinary field types.

Hope this helps!
 
Share this answer
 
Comments
sachin Bhosale @ code 12-Jun-14 0:26am    
I will try this !
sachin Bhosale @ code 12-Jun-14 0:35am    
Actually, I want to store FOS to Sql Server.

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