Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to store file in database.

Author  Topic 

pmotewar
Yak Posting Veteran

62 Posts

Posted - 2010-03-03 : 04:37:06
Hi All,
i want to store various type of file ( like .xls , .mdb , .txt , .dbf) into database table and i want to retrive it also. is there any way to do this ? which datatype i need to use ?
any answers appriciated.

if you have any link then please please reply.

Pankaj

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2010-03-03 : 04:51:23
You must compress the file as byte (using front end) and store in a table. You must use Image Datatype for it.


Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

haroon2k9
Constraint Violating Yak Guru

328 Posts

Posted - 2010-03-03 : 05:05:03
As per my suggstion <b>varbinary(max)</b>

Assuming you have valid reason for chosen the file storing in Db.
Go to Top of Page

pmotewar
Yak Posting Veteran

62 Posts

Posted - 2010-03-03 : 05:13:45

quote:
Originally posted by haroon2k9

As per my suggstion <b>varbinary(max)</b>

Assuming you have valid reason for chosen the file storing in Db.



Here are my scenario,

we have import utility in one of our project where we import data from various sources (as mentioned file types above). we take all data in temporary tables and process it and only valid data stores in the main ( permanant) table.
we are using the windows based application.
instead of storing file on a single remote location i want it to sotes these files in database and if requred get back/delete these uploaed files. so if any reason if i required to install application in other machine then i do not need to move these files also.

hope this helps you guys
now please tell me the proper solution.





Pankaj
Go to Top of Page

haroon2k9
Constraint Violating Yak Guru

328 Posts

Posted - 2010-03-03 : 05:42:31


Soory,i din't get you(Though iam not a expert).
nope.experts here to help you out.

please make sure your represented your requirement much clear.this would help them to sort your problem easily..
Go to Top of Page
   

- Advertisement -