Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Storing Word Documents in SQL Server

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

839 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