0
我有表TBL( SomeName为nvarchar(64) )OLEDB比较问题nvarchar的反对NTEXT(SQLServer的2005)
在OLEDB我想选择 SELECT 1 FROM Tbl1 WHERE SomeName = ?
结合3的Unicode字符作为参数原因:DB_E_ERRORSINCOMMAND(0x80040E14L)“为nvarchar的数据类型和ntext是在等于操作者不兼容的”
我已经尝试以下输入绑定:
1) ...
currentBind.wType = DBTYPE_VARIANT;
currentBind.cbMaxLen = 20
// where data points to valid VT_BSTR allocated by SysAllocString
...
2) ...
currentBind.wType = DBTYPE_WSTR;
currentBind.cbMaxLen = 20
// where data points to valid VT_BSTR allocated by SysAllocString
...
以任何方式SQLServer将此参数作为ntext处理。 有什么建议吗?先谢谢你。
是的,它有帮助。 SQL Profiler正好显示我的?作为ntext处理(参见@ p2波纹管): declare @ p1 int set @ p1 = 21 exec sp_prepexec @ p1输出,N'@ P1 bigint,@ P2 ntext,@ P3 bigint',N' – Dewfy 2009-08-05 17:05:31