Solved

Storing Word Documents in SQL Server

Posted on 2010-11-12
4
186 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
[X]
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
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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
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.

733 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