how to store flat files in SQL SERVER??

  • how to store flat files in SQL SERVER?? I need to store files like .doc, .pdf, .xls, .ppt in database.hw can i do it?? I m using ASP for retrieval of data.

    Please help, I will really appreciate it.

    Thanks

  • The same questions popped up earlier this week.

    Have a look at

    http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=9&messageid=222383

    or try a search on the forums on

    blob, pdf ...

    Haven't done it myself

  • dont put the files in the database.    save all the files in a directory(like a FTP Directory), and put a PATH of the files and the name of thes in the database.   Then use ASP to retrieve the files path   T

  • I agree with ghughes.

    Sounds like you're using an ASP upload component to allow users to upload from the browser? Usually you're better off storing files in a directory, and then the file paths in the database.

    Also, I wouldn't call these flat files (which usually describes text/csv files that you want to import to or export from the database). You're talking about binary files.. otherwise known as BLOBs (binary large objects).

  • Thanks a lot for ur replies.

  • I'm having trouble with inserting the actual file in sql.. I have the bytestream.

    what is the correct insert command for a image data type?


    Free your mind

  • ok...but why not store the files in the database. No offense to anyone, but I've found just as many people who say "DO IT" as those who say "DON'T DO IT". Which is it?

    I'm currently storing files in a folder and using my db to point to the path. The problem is I get orphaned rows in the db or I get orphaned files in the folder. It's almost impossible to assure data integrity if you don't put the files in the db.

    I am also having a the problem that if I access the files in the folder via a a mapped path or drive they work great!....but if I try to access these files through the web, ASP, or a vb application, it is really slow!

    Please help! I don't know what to do.

  • Well, for me the DB storage works great because it enhances security and organization. Also, for me it's a lot slower to upload files in ftp server (because it's remote) and they don't grant me all the security rights I would like for the files. Anyway think of the trouble that means to store a file on folder then store the path on the database and then order the files, name the files correctly... What if someone bye mistake gets access to that folder ans says "What a bunch of trash using all this space" and just delets them all?

    I know storing files in a DB has it's own problems (bottlenecks, indexing, etc...) but in my personal experience it overcomes a lot of other problems.

    Let me know if you need any code for uploading files and dowloading. As it turns out, it's not that difficult.

    Let me know your comments!


    Free your mind

  • HI, I am interested in finding out how to store binary, xml and text files in SQL server. Can some one please help?

    Thanks,

    Sonali

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply