Page 1 of 1

SQL Server balks at create of BLOB field

Posted: Wed 28 Sep 2011 14:20
by tonymeadors
Background:
[i][i]We are moving a huge suite of tools from D7 to D2010 and changing
from dbexpress connections to unidac-based connections.

With the same software we support IB, FB, MSSQL & Oracle.
The bear is dealing with all the datatype oddities.[/i][/i]


Seems that sql server balks at creating table with field datatype BLOB.

q.sql.add( 'create table simple(xinteger integer, xblob blob) ' );
q.execsql;

Yields error:

"...raised exception class EMSError with message 'Comun, parameter, or variable #2: Cannot find data type BLOB."

Same DDL:
oracle works
interbase works
sql server errors
(sql server 2005 that has always supported blobs through dbexpress components)

Looking for similar code to work with most data/query activities.

sincerely,
tonyM

Posted: Thu 29 Sep 2011 15:43
by AndreyZ
SQL Server doesn't have the BLOB type. You can use the VARBINARY(MAX) type instead. You can find more information about SQL Server types here: http://msdn.microsoft.com/en-us/library/ms187752.aspx

Posted: Fri 30 Sep 2011 17:37
by tonymeadors
Yup,

You are exactly right.
We have used IMAGE for sql server binary for
years - but our hasty testing ignored that fact.

Thank you,

tonyM