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
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
You have to use image field type for the stroing these types of data into sqlserver. this is asp.net example http://weblogs.asp.net/cazzu/archive/2003/08/27/25568.aspx
There are ways of "pushing" documents from ASP pages, where the user won't know the actual file location.
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
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
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
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.
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
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.
See if this helps: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1161.mspx -- Frank Kalis SQL Server MVP http://www.insidesql.de
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.
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
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
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 />
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.