pymssql text type

marc wyburn marc.wyburn at googlemail.com
Fri Feb 20 12:33:13 EST 2009


Hi, I'm trying to pass a text blob to MS SQL Express 2008 but get the
follwoing error.

(<class 'pymssql.OperationalError'>, OperationalError("SQL Server
message 102, severity 15, state 1, line 1:\nIncorrect syntax near
'assigned'.\n",), <traceback object at 0x044ABDF0>)

the string it is having an issue with is

(\r\n\r\n\tLogon ID:\t\t(0x0,0xE892A8)\r\n\r\n\tLogon Type:\t2\r\n\r
\n')

It looks like SQL is reading the blob, finding the newline codes and
generating an error.  Is there anyway I can get it to ignore the text
and just enter the whole sentance as a string.  I think that some
automatic character encodign might be taking place hence the string is
being read but I can work out whether I need to character encode in
Python, change a table setting in SQL or do something to pymssql.

Thanks, Marc.



More information about the Python-list mailing list