Store a text file in a sql field

kcwallace

Well-known member
Joined
May 27, 2004
Messages
172
Location
Irvine, CA
Can someone show me how to directly add a text file into a database using SQL Server 2000. It is my understanding that I need to use a image field. I am unsure how to do this.

The file is very large, and do to political constaints I cannot store a file location instead.

I would also be open to storing the contents of the file in a memo field, but SQL Server returns an error saying the data will get truncated.

I will also need to know how to retrieve it too.
 
kcwallace said:
Can someone show me how to directly add a text file into a database using SQL Server 2000. It is my understanding that I need to use a image field. I am unsure how to do this.

The file is very large, and do to political constaints I cannot store a file location instead.

I would also be open to storing the contents of the file in a memo field, but SQL Server returns an error saying the data will get truncated.

I will also need to know how to retrieve it too.

Load your text file into array of bytes and use that array as the parameter for the sql statement.
 
Back
Top