ben84
asked on
Chunking to ntext / image columns in SQL Server Compact Edition 3.5
Hi all!
I'm trying to store (potentially) large files in a SQL Server Compact Edition SDF file, via a table with an image column. Image columns hold up to 2GB.
Every SQL CE example I've found which does this reads the whole file into a Byte array, then passes the array in a SqlCeParameter. This is fine assuming that the file is small, or the code is run on a machine with plenty of memory. But if, for example, you're trying to store a 1GB file on a PC with 512Mb, the whole file cannot be buffered in one go (without paging).
What I want to be able to do is read and store "chunks" of a file into an image col. E.g. http://support.microsoft.com/kb/317034 I think this approach is both faster and more mem efficient. It is possible on SQL Server 2008 etc., using either UPDATETEXT or UPDATE ... [column name].write( ..., ..., ...). However, SQL CE doesn't appear to support either syntax.
So, I guess my question boils down to: is it possible to store a 2Gb file in an SQL CE image column on a PC with 1GB of mem. (without spending ages paging)
Thanks in advance,
Ben.
I'm trying to store (potentially) large files in a SQL Server Compact Edition SDF file, via a table with an image column. Image columns hold up to 2GB.
Every SQL CE example I've found which does this reads the whole file into a Byte array, then passes the array in a SqlCeParameter. This is fine assuming that the file is small, or the code is run on a machine with plenty of memory. But if, for example, you're trying to store a 1GB file on a PC with 512Mb, the whole file cannot be buffered in one go (without paging).
What I want to be able to do is read and store "chunks" of a file into an image col. E.g. http://support.microsoft.com/kb/317034 I think this approach is both faster and more mem efficient. It is possible on SQL Server 2008 etc., using either UPDATETEXT or UPDATE ... [column name].write( ..., ..., ...). However, SQL CE doesn't appear to support either syntax.
So, I guess my question boils down to: is it possible to store a 2Gb file in an SQL CE image column on a PC with 1GB of mem. (without spending ages paging)
Thanks in advance,
Ben.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER