September 30, 2009 at 12:21 pm
Hello Everybody,
I want to insert a word document ( .doc ) into my table which keeps for example , applicant's name and his/her resume. So, in one column i will insert name , and in another column i want to insert resume.
I know that it can be done using ADO.NET or by using programming. But is there any way to insert it just by using T-SQL ?
BTW , i have both SQL Server 2005 and 2008
Any help is appriciated ..
thanks
September 30, 2009 at 12:23 pm
Check out OpenRowset, the options for Bulk and Single_BLOB. That should allow you to import a file into a binary field.
I'd be more inclined to store the Word file in a directory and store a path to it in SQL, rather than storing the binary directly in SQL, since that's generally faster and more stable/reliable.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
October 1, 2009 at 11:45 am
If you have Sql 2008 then you can look at FileStream Storage. In principle, its the same as storing it in the filesystem but it is much more tightly integrated with Sql Server for eg. you can include them in your routine database backups.
October 1, 2009 at 2:14 pm
I think openstream option is good enough for me. But sure will try filestream too.
But I also think that , it may be good to store data in database itself , because
1. DBMS gives stored file same security as it gives to data.
2. If stored outside DB, then I can't backup them using BACKUP, but have to backup them using OS commands.
Same can be achieved using Filesteam too.
But still it depends what is individual's requirements , right ?
Thank you guys for your time and replies.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply