Monday, March 26, 2012

Saving files to SQL Server 2000

Someone:
I have the need to upload a file via a webpage and then save that file into the database. I would also like to retrieve it and show it to the user.

Can someone show me an example of how this should be done. Also I am concerned of the pros and cons of saving files in the database. Is there a performance hit on the server? Will it make the database unstable? Has anyone had problems doing this?

Any suggestions, samples, and/or help are welcome.What kind of files are you attempting to save to the database, images?
Yes, there is a performance hit by placing the file into the database, and you are also increasing the size lots. Remember, if you have 100 rows of data in the table that stores the image in a column and you only have actually 2 images it is saving space for all 100 rows to have an image in there. I really don't think it will make the database unstable, but storing files in the physical folders of the application just seem like a better idea to me. Perhaps in SQL server Yukon this will change since I hear you can store objects in it.|||A database is not a file store. While SQL Server can store binary data, this is not as efficient as storing files in a file system.

File system = designed for storing files
Database = NOT designed for storing files.

Don't do it.|||Pierre:
Thanks for your comments. I have to say that I agree with you. However there are instances that storing a file in the database is more compelling than the file system and you have to weigh both options. Hence my post.

-SosaWISE

No comments:

Post a Comment