Solved

Storing Word Documents in SQL Server

Posted on 2010-11-12
4
183 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 70

Expert Comment

by:Éric Moreau
ID: 34125508
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

773 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