Information générale
Titre:
Storing File Contents in SQL Server Image Data Type
I was trying to write an application that would store a binary image of actual file contents to SQL Server. I stored the file contents to a variable using lcContents = FILETOSTR( ) and then tried to include this in an INSERT command:
SQLEXEC( lnConn, [INSERT INTO MyTable ( ,,, Fil_Contents ) VALUES ( ,,, ?lcContents )] )
This failed with the following error from SQL Server:
Connectivity error: [Microsoft][ODBC SQL Server Driver][SQL Server]Operand type clash: text is incompatible with image
Any idea what I did wrong? The field Fil_Contents is using the "image" data type, which BOL indicated was correct for binary data larger than 8K.
TIA,
-- Randy
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement