2

stockView がフルテキスト インデックス付きのインデックス付きビューである場合、次のエラー メッセージが表示されます。データベースは、2005 互換モードの 2008 Express エンジンで実行されています。

コード:

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.

内部結合と加重列を削除すると、クエリが機能します。どんなアイデアでも、私は途方に暮れています。

4

3 に答える 3

1

R2でも修正されていませんが、修正プログラムがあります。KB記事#2421014を参照してください。

于 2011-07-01T00:38:37.910 に答える
0

しぶしぶ、CTE の代わりにテーブル変数を使用することにしました。

declare @stockTemp table(
    title               nvarchar(100),
    grade               nvarchar(50),
    price               money,
    row                 bigint
);

insert into @stockTemp
select sv.[title]                   ,
        sv.[grade]                  ,
        sv.[price]                  ,
        row_number() over (order by (case when sv.[issue] = @issue and svs.[rank] > 30
                                            then svs.[rank] + 100
                                            else svs.[rank]
                                            end) desc,
                                        sv.title,
                                        sv.grade desc,
                                        sv.price asc)
from stockView sv
inner join freetexttable(stockView, (*), @term) svs
    on sv.[id] = svs.[key]

select * from @stockTemp;

誰かがより良い提案を持っている場合は、私に知らせてください。

于 2009-06-14T17:43:50.863 に答える
0

エラー レベル 11 は、データベース オブジェクトが見つからないことを示します。freetexttable クエリの選択は選択として機能しますか? その場合、完全なクエリは選択として機能しますか (cte 定義なしで?)

于 2009-06-14T17:06:30.733 に答える