in reply to storing files with dbi & sqlserver

Wouldn't it be easier to store the files on the filesystem somewhere and then use the database to hold their locations and any metadata? That way you can lookup the file in the DB, get the location, and grab it from the harddrive.

Replies are listed 'Best First'.
Re: Re: storing files with dbi & sqlserver
by perlplexer (Hermit) on May 04, 2003 at 18:41 UTC
    Depending on how the system is architected, storing files on disk may not be appropriate. In large systems, SQL server usually lives on its own box or a cluster of boxes, and application that uses this SQL server has no direct access to the disk(s).

    Also, if you store file names only, you can't easily delete files via SQL statements. You'd either need a separate application for that or you'd have to write some sort of stored procedure. This is not necessarily bad, it's just something that you'd have to keep in mind.

    --perlplexer
Re: Re: storing files with dbi & sqlserver
by Anonymous Monk on May 04, 2003 at 18:19 UTC
    Yes, it would be much better, but our client doesn't seem to think so. it seems so pointless to store all these files when the hard disk is the perfect repository. michael
      Ah, I see. You should really try to convince the client otherwise. You, after all, are the one with the experience and knowledge; they shouldn't be telling you what is best.

      In any case, sorry I can't help. I don't do work with Microsoft products and haven't ever stored files in a DB. If you were using MySQL though, you'd probably want to use a blob for the column type. I believe it can hold binary or ASCII data. I don't know if MSSQL has that type.