尝试使用 CTE FREETEXTTABLE 索引视图时出现严重错误
当 stockView 是带有全文索引的索引视图时,我收到以下错误消息。 该数据库在 2008 Express 引擎上以 2005 兼容模式运行。
代码:
with stockCte (title, grade, price, weighted)
as
(
select sv.[title] ,
sv.[grade] ,
sv.[price] ,
(case when sv.[issue] = @issue and svs.[rank] > 30
then svs.[rank] + 100
else svs.[rank]
end) weighted
from stockView sv
inner join freetexttable(stockView, (name), @term) svs
on sv.[id] = svs.[key]
)
select * from stockCte;
错误:
Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.
Msg 0, Level 20, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.
当我删除内部联接和加权列时,查询有效。 任何想法,我都不知所措。
Where stockView is an indexed view with a full-text index, I receive the error message below. The database is running on a 2008 Express engine in 2005 compatibility mode.
Code:
with stockCte (title, grade, price, weighted)
as
(
select sv.[title] ,
sv.[grade] ,
sv.[price] ,
(case when sv.[issue] = @issue and svs.[rank] > 30
then svs.[rank] + 100
else svs.[rank]
end) weighted
from stockView sv
inner join freetexttable(stockView, (name), @term) svs
on sv.[id] = svs.[key]
)
select * from stockCte;
Error:
Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.
Msg 0, Level 20, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.
The query works when I remove the inner join and the weighted column. Any ideas, I'm at a loss.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我很不情愿地使用表变量而不是 CTE。
如果有人有更好的建议,请告诉我。
Reluctantly I have resorted to using a table variable instead of a CTE.
If anyone has any better suggestions, please let me know.
R2 中也没有修复此问题,但有一个修补程序 - 请参阅知识库文章 #2421014。
It hasn't been fixed in R2 either, but there is a hotfix for it - see KB article #2421014.
错误级别 11 是未找到数据库对象; freetexttable 查询上的 select 是否作为 select 工作? 如果是这样,完整查询是否作为选择工作(没有 cte 定义?)
Error Level 11 is database object not found; does the select on the freetexttable query work as a select ? If so does the full query work as a select (without the cte definition?)