Solved

Storing Word Documents in SQL Server

Posted on 2010-11-12
4
181 Views
Last Modified: 2012-05-24
I am aware that the advised method of doing this is to store the documents on the file system and use SQL for the file information.  Aside from this, I'd like to store a copy of the document in SQL Server itself.  I have no problem getting the files into SQL, but am not sure how to write them back out to the hard drive so that the exported file is essentially identical to the original file.

If you can gives specifics, I'd really appreciate it, thanks.

-Mari
0
Comment
Question by:FoxProMari
4 Comments
 
LVL 3

Expert Comment

by:Epitel0920
ID: 34124731
You should use the image data type. There you can store .pdf, .doc, or anything like that
0
 
LVL 4

Accepted Solution

by:
Amgad_Consulting_Co earned 350 total points
ID: 34124747
Hi,

if you are working on SQL server 2008 you should check the filestream feature in it, see this links for more: http://technet.microsoft.com/en-us/library/bb933993.aspx   .

However, if you are using older version you should store the files as binary files in binary fields, for how to and limitations see this:
1. http://chiragrdarji.wordpress.com/2007/08/31/storing-and-retrieving-docpdfxls-files-in-sql-server/
2. http://msdn.microsoft.com/en-us/library/ms188362(SQL.90).aspx






0
 
LVL 15

Expert Comment

by:AmmarR
ID: 34124986
Why dont you consider Sharepoint
its perfect for storing documents

but if you want to do it with sql directly

check out this post
http://social.msdn.microsoft.com/forums/en-US/vbgeneral/thread/0fb5fd05-3eb5-4568-9e2a-fd9ba5ed5a3e

it has useful links

http://www.codeproject.com/KB/database/Store_and_manipulat_BLOBs.aspx
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 34125508
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how the fundamental information of how to create a table.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now