writing a file into a Table

  • Thread starter Thread starter irshad
  • Start date Start date
I

irshad

Hello All,
I would like to save a file into the existing table of a
Sql-server 2000 database....Any Ideas

Thanks
 
The 'best' method will depend on the file type and file
size. You can use a stream if the file is small and
store the values in a variable and send the variable to
SQL Server. This won't work if the file isn't pretty
small and it certainly doesn't scale well.

Here's a link taking advantage of the the BLOB in SQL
Server...most DB's support BLOB as well.

http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/cpguide/html/cpconwritingblobvaluestodatabase.asp

You can also store a link with the file path in it in a
field and reference it that way. This is often
a 'better' approach for DB performance concerns but
doesn't do anything for you if you need the file to exist
in the db as opposed to a file system somewhere.

I've loaded images in an app before with Blobs, and it
gave me a lot of headaches...know a lot of other
developers who've reported the same.

Good Luck,

Bill


W.G. Ryan

(e-mail address removed)
www.knowdotnet.com
 
Back
Top