all groups > sql server programming > november 2003 >
You're in the

sql server programming

group:

Storing large files on a server



Storing large files on a server Gary Nastrasio
11/17/2003 11:01:36 PM
sql server programming: Hi guys, first, sorry if this is the wrong form for this, but I hate
cross posting and I had to choose someplace to post. Anyway, here's my
project:

- Database server running SQL Server 2000
- Database server stores files of size generally > 3MB
- Client program accesses SQL Server 2000 and files

I currently have it set up so the DB tables stores the filename as text
using varchar. The file physically exists somewhere else on the DB
server. On the client, at startup, everything is loaded into client
memory, via some crazy tree data structure I made. The files are then
copied over by the client using the Win32 API function, CopyFile. The
files are copied from a drive mapping on the client to the DB server.

This method works, but I was informed by a co-worker that there are
alternatives. Unfortunately I couldn't really understand his method and
there are certain language barriers. :) No big deal, but what he
described sounded interesting. It was something about letting the DB
server handle the files. A pointer to the file would be stored in the
database and I could just access that. He said this wasn't the same as
storing the actual file inside SQL Server (as a blob or whatever).

Can anyone offer and suggestions? This would be very helpful by the
fact that I can create a tool such that the user can insert a new entry
into the database, attach a file in the tool program and submit it to
SQL Server 2000. SQL 2K would then somehow store the file.

Thanks for any help!
Re: Storing large files on a server Greg Obleshchuk
11/18/2003 4:12:50 PM
Hi Gary,
I haven't heard of anything like that. The two methods I know of are the
way you are doing it, but I wouldn't use dive mappings I would store the URL
(i.e \\Servername\ShareName\DirectoryName\FileName This way you can move
them around you network and the clients don't need drive mappings. The
second is storing the files as blobs, which I don't like.

TSQL has not concept of real files so there is no reference to the file
system.


--
I hope this helps
regards
Greg O MCSD
http://www.ag-software.com/ags_scribe_index.asp. SQL Scribe Documentation
Builder, the quickest way to document your database
http://www.ag-software.com/ags_SSEPE_index.asp. AGS SQL Server Extended
Property Extended properties manager for SQL 2000
http://www.ag-software.com/IconExtractionProgram.asp. Free icon extraction
program
http://www.ag-software.com. Free programming tools


[quoted text, click to view]

AddThis Social Bookmark Button