MSSQL negative SMALLINT returned by SA as weird number

25 views
Skip to first unread message

Matt Bodman

unread,
Oct 13, 2011, 3:27:38 AM10/13/11
to sqlal...@googlegroups.com
I have a SMALLINT column in MSSQL.  The value of the column is -2

SQLAlchemy also has the column as SMALLINT but the value is translated as 4294967294

I can't seem to correct this and I haven't found anything on SA and negative numbers.  Any help would be really great, thanks.

Michael Bayer

unread,
Oct 13, 2011, 9:49:30 AM10/13/11
to sqlal...@googlegroups.com
this is something occurring within the DBAPI you're using, i.e. pyodbc, pymssql, etc.   you'd need to compose a simple test case using only the DBAPI (else the DBAPI authors will suspect its on SQLAlchemy's side) and report it to them.

if a plain DBAPI test does not reproduce the problem, send it over here and we can compare the plain DBAPI case to the SQLAlchemy case.   unlikely here since SQLA doesn't do anything with ints coming back from the database.



--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sqlalchemy/-/F49ec3O3IGkJ.
To post to this group, send email to sqlal...@googlegroups.com.
To unsubscribe from this group, send email to sqlalchemy+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.

Matt Bodman

unread,
Oct 13, 2011, 4:57:02 PM10/13/11
to sqlal...@googlegroups.com
makes sense.. I'm using pydobc. I do the test you suggested.. thanks!
Reply all
Reply to author
Forward
0 new messages