专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅

首页 »Python » ntext:pymssql ntext字段调用问题解决思路方法 »正文

ntext:pymssql ntext字段调用问题解决思路方法

来源: 发布时间:星期日, 2009年9月6日 浏览:5次 评论:0
下面是方式:

Example script - pymssql module (DB API 2.0)

Example script - _mssql module (lower level DB access)

不过在我使用过程中发现如果表中包含了ntext字段就会出错提示

不能用 DB-Library(如 ISQL)或 ODBC 3.7 或更早版本将 ntext 数据或仅使用
Unicode排序规则 Unicode 数据发送到客户端

查了发现官方网站WebSite有解释:

Q: What means "Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library"?

A: If you connect to a SQL Server 2000 SP4 or SQL Server 2005, and you make a SELECT query _disibledevent=>_mssql.error: SQL Server message 4004, severity 16, state 1, line 1:
Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier.

It's the SQL Server complaining that it doesn't support pure Unicode via TDS or older versions of ODBC. There's no fix for this error. Microsoft has deprecated DB-Library a long ago, in favor of ODBC, OLE DB, or SQL Native Client. Many features of SQL 2005 aren't accessible via DB-Library so you need them, you have to switch away from pymssql or other tools based _disibledevent=>SELECT cast ( field_name AS TEXT ) AS field_name



问题可能是ntext和text字段所支持长度不所以也许你还需要设置下TEXTSIZE

SET TEXTSIZE 65536



当然你还可以将字段设置这个就看你需要了

0

相关文章

读者评论

发表评论

  • 昵称:
  • 内容: