writing a file into a Table

I

irshad

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

Thanks
 
W

William Ryan

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top