SQL Server Performance

Storing Word Document

Discussion in 'General Developer Questions' started by Madhivanan, Apr 28, 2005.

  1. Madhivanan Moderator

    I want to store Word document in a table. First I tried to add the physical path of file to the table and later retieved it. Now As I dont want others to physically open the files, I decided to store the file itself in a text datatype field. Is this a good idea? And I dont know whether text field is capable of storing the files having 5 or more MBs. What do you think is the feasible method?


    Madhivanan

    Failing to plan is Planning to fail
  2. dineshasanka Moderator

    Check this

    http://www.codecomments.com/archive351-2005-3-406147.html

    quote:Originally posted by Madhivanan

    I want to store Word document in a table. First I tried to add the physical path of file to the table and later retieved it. Now As I dont want others to physically open the files, I decided to store the file itself in a text datatype field. Is this a good idea? And I dont know whether text field is capable of storing the files having 5 or more MBs. What do you think is the feasible method?


    Madhivanan

    Failing to plan is Planning to fail
  3. dineshasanka Moderator

  4. Adriaan New Member

    There are ways of "pushing" documents from ASP pages, where the user won't know the actual file location.
  5. Madhivanan Moderator

    Thanks Dinesh.
    I am using VB6 as Front end. The example found at your link seems not working. Can you tell me the way to insert Word document to text field in a single query?


    Madhivanan

    Failing to plan is Planning to fail
  6. dineshasanka Moderator

    yes both of the example are for image filed, is there any specific reason to you to go with text filed.


    quote:Originally posted by Madhivanan

    Thanks Dinesh.
    I am using VB6 as Front end. The example found at your link seems not working. Can you tell me the way to insert Word document to text field in a single query?


    Madhivanan

    Failing to plan is Planning to fail
  7. Madhivanan Moderator

    Ok No problem. I can use image field also. But is there anyway to insert the document in a single query?
    eg
    Insert into mytable(DNo,Document) values(1,'Contents of Word Document as Image')


    Madhivanan

    Failing to plan is Planning to fail
  8. satya Moderator

    Is it a compulsory option to store the docuement in SQL Server, for the performance matter its better to store the link and refer from application.

    Satya SKJ
    Moderator
    http://www.SQL-Server-Performance.Com/forum
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
  9. Madhivanan Moderator

    Yes Satya, I know that but I was asked to store some important documents in the database and those will be deleted physically.


    Madhivanan

    Failing to plan is Planning to fail
  10. dineshasanka Moderator

    Satya is correct
    anyway madihiwan i don't think u can simply use insert command for that.


    quote:Originally posted by satya

    Is it a compulsory option to store the docuement in SQL Server, for the performance matter its better to store the link and refer from application.

    Satya SKJ
    Moderator
    http://www.SQL-Server-Performance.Com/forum
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
  11. FrankKalis Moderator

  12. ranjitjain New Member

    Hi madhivanan, the image datatype stores the value in binary format right....
    So first u need to convert ur file in binary format and then append chunk.

    Direct insert query will not work here as i tried this alot too.
    i wanted to upload candidates photos.
  13. ranjitjain New Member

  14. Madhivanan Moderator

    quote:Originally posted by ranjitjain

    Hi Madhivanan,
    check this topic. Even i had same issue
    http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=7186

    and i'm still looking for the solution.
    If u want i can post the code by which we upload photo from VB using ado

    Yes Ranjit, It will be helpful, if you post that code


    Madhivanan

    Failing to plan is Planning to fail
  15. FrankKalis Moderator

    Read the link I've posted. It is by far the most complete discussion about BLOBs and SQL Server I've found so far. And it also includes code samples [<img src='/community/emoticons/emotion-1.gif' alt=':)' />]<br /><br />--<br />Frank Kalis<br />SQL Server MVP<br /<a target="_blank" href=http://www.insidesql.de>http://www.insidesql.de</a><br />
  16. ranjitjain New Member

    thanx frank the link u provided says it all.[<img src='/community/emoticons/emotion-1.gif' alt=':)' />]<br />So using ado there is just a way left i.e. appendchunk and getchunk.<br />Thanx again.

Share This Page