473,219 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,219 software developers and data experts.

Storing Documents and Images - In the database or as a link?

Hi There,

Being quite new to MS-SQL I would like to ask if there is a general opinion
of what approach should be taken to storing things like external documents
and images in databases.

Should the actual files be stored within the database, or instead should
links to the files on a file server or something similar be stored instead.

For the end user I imagine it is easier to have everything stored within the
database, because doing it the other way in effect gives another level of
management because there is the need to perhaps manually look after the file
server with all the image files or document files on.

In my particular case, I am building a database where the users use a great
many Word documents. For example, I particular record might have a number of
different Word documents associated with it.

I was going to create a "Documents" table that all documents were stored in
(including meta data about each document because it will be really useful to
be able to search for documents so that they can be reused).

In this table I was in a dilemma as to whether to actually store the
documents in the table. Other then the performance hit and memory
requirements this will require, are there any other disadvantages?

What are the general thoughts when a database needs to manage a lot of pdf
and word documents?

Thanks in advance.

Dave.
Jul 20 '05 #1
3 2910
nib
inline...

Dave Smithz wrote:
Hi There,

Being quite new to MS-SQL I would like to ask if there is a general opinion
of what approach should be taken to storing things like external documents
and images in databases.
Depends on what your situation warrants.

Should the actual files be stored within the database, or instead should
links to the files on a file server or something similar be stored instead.
Either works. Both have pros and cons.

For the end user I imagine it is easier to have everything stored within the
database, because doing it the other way in effect gives another level of
management because there is the need to perhaps manually look after the file
server with all the image files or document files on.
You can automate the storage/retrieval of the documents even if they're
stored in a directory instead of the database.

In my particular case, I am building a database where the users use a great
many Word documents. For example, I particular record might have a number of
different Word documents associated with it.

I was going to create a "Documents" table that all documents were stored in
(including meta data about each document because it will be really useful to
be able to search for documents so that they can be reused).

In this table I was in a dilemma as to whether to actually store the
documents in the table. Other then the performance hit and memory
requirements this will require, are there any other disadvantages?


Personally, I lean towards using the database for storage. A quick list
of why:

1) Store multiple documents for the same entity without having to create
naming standards
2) Security
3) only allows editing via your applications

cons:

1) requires additional programming on your end due to dealing with blobs
2) takes more db space (but, you'll be taking up the space anyway)

Zach
Jul 20 '05 #2
Dave Smithz (SPAM FREE WORLD) writes:
Being quite new to MS-SQL I would like to ask if there is a general
opinion of what approach should be taken to storing things like external
documents and images in databases.

Should the actual files be stored within the database, or instead should
links to the files on a file server or something similar be stored
instead.


Many people advocate storing files on disk and only store the links in
the database. Undoubtedly, this solution is a lot simpler to implement,
since to store the documents in the database you need to use the image
datatype which is not very simple to work with.

But if you store files on disk, you don't have the consistency check that
transactions buys you. You may store a link in the database, but the
file is for some reason not stored on disk or vice versa. And if someone
uses the Explorer to search the directory, he might delete files by
accident or malice. Of course a malign intruder may delete data in your
database, but you are probably safer to accidents.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #3
If you store them in the database you know for sure where each one is.
If you store the path, people can move the files and then your
database is kinda useless.

On Mon, 25 Oct 2004 20:49:31 +0100, "Dave Smithz" <SPAM FREE WORLD>
wrote:
Hi There,

Being quite new to MS-SQL I would like to ask if there is a general opinion
of what approach should be taken to storing things like external documents
and images in databases.

Should the actual files be stored within the database, or instead should
links to the files on a file server or something similar be stored instead.

For the end user I imagine it is easier to have everything stored within the
database, because doing it the other way in effect gives another level of
management because there is the need to perhaps manually look after the file
server with all the image files or document files on.

In my particular case, I am building a database where the users use a great
many Word documents. For example, I particular record might have a number of
different Word documents associated with it.

I was going to create a "Documents" table that all documents were stored in
(including meta data about each document because it will be really useful to
be able to search for documents so that they can be reused).

In this table I was in a dilemma as to whether to actually store the
documents in the table. Other then the performance hit and memory
requirements this will require, are there any other disadvantages?

What are the general thoughts when a database needs to manage a lot of pdf
and word documents?

Thanks in advance.

Dave.


Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: faris_idris | last post by:
Hello, we are using Oracle 9i for client and server and Powerbuilder 8.0.3. We have a database link between two databases, whenever I try to do a simple select, update or insert I get the following...
0
by: wqhdebian | last post by:
It was said the ORA-02085 error result from the mismatch of database name and database link name ,and setting glabal_names=false can resolve . but I want to try the other solution,let global_names...
2
by: Dmitry Duginov | last post by:
Here's a problem -------------------------------------------- set serveroutput on DECLARE CURSOR cur is select ed_no, length(ed_no) as len from listtext@pubdb.world; BEGIN for cur_rec in cur...
1
by: Lothar Armbr?ster | last post by:
Hello out there, this morning I had to get some rows via flashback query. Since my undo retention is just 3h, the undo segments were already aged out. But I have a physical standby database that...
2
by: John A. | last post by:
Hello. I'm trying to have an image (a GIF with transparency) overlayed on certain of several inline images that link to different pages. What I have so far looks right (or right enough) in...
1
by: ntiruhar | last post by:
Hi all, My requirement is to migrate all the data from DB2 database to SQL Server database. Is it possible to create a database link between these two databases. regards, Naren
4
by: Zeljko Bilandzija | last post by:
Hy, could someone help me in this: In design mode, i want to put pictures in database. I made column named pics, and its type as image. How can I put pictures or some address of these pictures...
1
by: holdingbe | last post by:
Hi, How to select data from one table from another database? I have two databases such that Source:=michael destination=aster I login in michael database as scott schema . Now i...
2
by: holdingbe | last post by:
Hi, I get very difficult requirement from my friend. I explain clearly below : I have two databases. Source databases: Flower |__________schema: sample. ...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.