从 SQL Server 收到未知令牌

发布于 2024-07-07 19:53:26 字数 50 浏览 7 评论 0原文

当我尝试在 SQL Server 查询分析器中运行查询时,出现此错误。 是什么原因?

I got this error when trying to run a query in SQL server query analyzer.
What is the reason?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

浸婚纱 2024-07-14 19:53:26

如果您正在使用游标,那么您可能已经关闭了游标。 查看 MSDN 了解更多信息 (http://support.microsoft.com/kb/15169 3)

如果您没有使用游标,则可能是服务器出现问题,请检查日志。

If you're using cursors, then you've probably closed the cursor. Check out MSDN for more information (http://support.microsoft.com/kb/151693)

If you're not using cursors, then it could be an issue with the server, check the log.

原来分手还会想你 2024-07-14 19:53:26

在它消失在时间的沙子中之前,知识库文章:


文章 ID:151693 - 上次审核:2003 年 10 月 3 日 - 修订版:3.0

修复:错误消息“从 SQL Server 接收到未知令牌”

症状

当您设置语句选项以使用服务器端游标时并在 SQL Server 系统表上准备 select 语句,第一次执行 select 成功创建游标。 关闭该游标后,如果再次执行准备好的语句,则会出现以下错误消息:

从 SQL Server 收到未知令牌。

解决方法

在系统表上使用只进游标,而不是静态、键集或动态游标。 请注意,如果在用户定义的表或视图上创建服务器端游标,则不会出现此问题。

如果只进游标不可接受,请在系统表上再次准备 select 语句并执行它以创建服务器端游标。 请注意,第一次执行工作正常,应用程序通常不需要在系统表上重复创建游标。

状态

Microsoft 已确认这是 Microsoft SQL Server 版本 6.50.0201 中的问题。 此问题已在 Microsoft SQL Server 6.5 版的 US Service Pack 1 中得到纠正。 有关更多信息,请联系您的主要支持提供商。

And before it's lost to the sands of time, the KB article:


Article ID: 151693 - Last Review: October 3, 2003 - Revision: 3.0

FIX: Err Msg "Unknown Token Received from SQL Server"

Symptoms

When you set the statement options to use a server-side cursor and prepare a select statement on a SQL Server system table, the first execution of the select creates the cursor successfully. After you close this cursor, if you execute the prepared statement again, the following error message appears:

unknown token received from SQL Server.

Workaround

Use a forward-only cursor instead of a static, keyset, or dynamic cursor on the system tables. Note that the problem does not occur if a server-side cursor is created on a user-defined table or view.

If a forward-only cursor is unacceptable, prepare the select statement again on the system table and execute it to create a server-side cursor. Note that the first execution works fine and applications typically do not need to create a cursor on a system table repeatedly.

Status

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.50.0201. This problem has been corrected in U.S. Service Pack 1 for Microsoft SQL Server version 6.5. For more information, contact your primary support provider.

烟酉 2024-07-14 19:53:26

我遇到过同样的问题。 我的问题是我创建了第二个 ADODB 连接,而不是使用初始 ADODB 连接。 删除第二个 ADODB 连接后,错误就消失了。 我相信错误的令牌问题是合法的,只有 2 个连接到同一个数据库。

I had the same issue. My issue turned out to be I created a second ADODB connection rather than using the initial ADODB connection. Once the second ADODB connection was removed, the error went away. I believe the bad token issue was legitimate, just 2 connections to the same DB.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文