I'm using Matlab R2014a to access a SQL database.
I uploaded the data to the database using Matlab.
The column is a FILESTREAM of type varbinary(MAX).
When I query the database with a SQL command such as:
SELECT DATALENGTH(imagedata) from imagedata
I get datalengths of 8198400, which is consistent with my image data.
When I query the database with a SQL command such as:
SELECT imagedata from imagedata WHERE imageID<3
I get 32767 bytes of data per image.
SELECT CAST(imagedata AS varbinary(MAX)) from imagedata WHERE imageID<3
...also returns 32767 bytes of data per image.
I suspect this may be related to: Binary Blob truncated to 8000 bytes - SQL Server 2008 / varbinary(max), but the relationship isn't obvious to me.
One webpage has mentioned that 64-bit Matlab may have issues with ODBC drivers and that switching to JDBC solved the problem, but that isn't a satisfactory solution as I suspect I am either getting the SQL wrong or have some defaults set incorrectly somewhere.