Hi,
I'm trying to store a pdf document as a binary into SQLServer and I don't know what datatype to use in SQLServer (2008)
In SQLBase this works fine:
Set nSize = VisFileGetSize(sFileName)
If SalFileOpen( hFile, sFileName, OF_Binary )
Set nResult = SalFileRead( hFile, bBinary, nSize )
Call SalFileClose( hFile )
Call SqlPrepare( hSql, 'INSERT INTO pdftable VALUES( :nId,bBinary)' )
Call SqlSetLongBindDatatype( 2, 23 )
Call SqlExecute( hSql )
Call SqlCommit( hSql )
Return TRUE
Table definition in SQLBase:
create table pdftable (id number not null, pdffile LONG VARCHAR);
I try to use varbinary(max) as datatype in SQLServer, but
when I do a select from SQLServer, I get a binary back that is 32001 in datalength.
My binary are more than 150000 in datalengh..
Anyone who knows?
Best regards
Maria
Help with storing PDF in SQLServer
Re: Help with storing PDF in SQLServer
Hi Maria
It works with Image data type but it may be deprecated after SQL Server 2014 release.
I think we need to check with Gupta whether there is any additional SET parameters to be setup for this varbinary(max).
Hope others in the forum might have experienced this issue.
Thanks!
Siva
It works with Image data type but it may be deprecated after SQL Server 2014 release.
I think we need to check with Gupta whether there is any additional SET parameters to be setup for this varbinary(max).
Hope others in the forum might have experienced this issue.
Thanks!
Siva
Re: Help with storing PDF in SQLServer
Hi,
I use the Datatype "VARBINARY" from SQLServer.
Enrico
I use the Datatype "VARBINARY" from SQLServer.
Enrico
Re: Help with storing PDF in SQLServer
Hi,
but are your varbinary bigger than 32000? It seems that there is a limitation at 32000?
Regards Maria
but are your varbinary bigger than 32000? It seems that there is a limitation at 32000?
Regards Maria
Re: Help with storing PDF in SQLServer
Hello,
VARBINARY(MAX) allows the storage of 2 GB of data. I think that's enough.
If you're using sqlodb32, check the sql.ini settings in the secion [odbcrtr].
Where is a value called longbuffer which limits the size of the transferred data.
(If it's not there, just add it!)
This is my setting and thats far enough!
Max
VARBINARY(MAX) allows the storage of 2 GB of data. I think that's enough.
If you're using sqlodb32, check the sql.ini settings in the secion [odbcrtr].
Where is a value called longbuffer which limits the size of the transferred data.
(If it's not there, just add it!)
Code: Select all
[odbcrtr]
longbuffer=2500000
Max
Who is online
Users browsing this forum: [Ccbot] and 0 guests