How to store a doc file as it is in a field?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hellboss
    New Member
    • Jun 2007
    • 50

    How to store a doc file as it is in a field?

    Hi !
    im workin with the SQL server05, i want to store a document file as it is into a field in my database.
    Some may suggest to extracting the text from the doc file to an array and passing it to the sp and save it ! I hope there should be a way around to store the document file as we save the images

    My primary question is !
    1. Can a .doc file be stored as it is in a data base field?
    2. If so what data type should i use is it ntext or some other ?

    Kindly provide me with a valid solution

    Thanks in advance
  • camel
    New Member
    • Jan 2008
    • 55

    #2
    You can store the document in SQL Server as a BLOB, the datatype is called Image in more recent versions of SQL Server. Look up SQL Server & BLOB in Google and you shall get a host of links explaining how to do this using ADO.

    One caveat you should be aware of...whilst you can store any form of file in SQL Server as a BLOB that does not mean that you should. You need to think carefully about the likely size of files you will be saving and how the db will grow There comes a point where lots of BLOB storage can affect performance of the database very badly, it is best to read up and anticipate the likelihood of this in advance. Ultimately the file system is more efficient for file storage than SQL Server and you always have the option to store pointers (i.e., file paths) and metadata only in the database and leave the heavy lifing of the files to Windows

    Comment

    Working...