我有以下问题。执行下面的查询时,我收到以下错误:
消息 0,级别 11,状态 0,行 0 当前命令发生严重错误。结果,如果有的话,应该丢弃。Msg 0, Level 20, State 0, Line 0 当前命令发生严重错误。结果,如果有的话,应该丢弃。
WITH PagingRows AS
(
Select
ROW_NUMBER() Over (Order By LastName ASC) As Row,AddressBookId
FROM
AccountView
WHERE
(
[AccountView].[AddressBookId] IN
(
SELECT [key] FROM CONTAINSTABLE([AccountView],*,'"searchword*" ')
)
)
)
Select
[t0].*
From
PagingRows c
Inner Join AccountView t0 on c.AddressBookId = t0.AddressBookId
Where
c.Row Between 0 + 1 AND 0 + 50
Order By c.Row Asc FOR XML AUTO, ELEMENTS XSINIL
“AccountView”是一个全文索引的视图。部分查询也可以单独工作。因为下面的查询执行没有问题。
SELECT
ROW_NUMBER() Over (Order By LastName ASC) As Row,AddressBookId
FROM
AccountView
WHERE
[AccountView].[AddressBookId] IN (
SELECT [key] FROM CONTAINSTABLE([AccountView],*,'"searchword*" ')
)
如果“AccountView”视图被表替换,则查询确实可以正常工作。我想知道如何解决这个问题以及错误的原因是什么。