SQLFOOL や SQL Authorities などとは異なるスクリプトを実行していますが、データベースを確認すると、最適化がまったく表示されません。動作しないコードを少し書きましたが、手を貸していただけますか?
Declare @table_name Varchar (70);
Declare table_cursor Cursor for
select OBJECT_SCHEMA_NAME([OBJECT_ID])+'.' + NAME AS Tablenamee
from sys.tables
open table_cursor
Fetch next from table_cursor into @table_name
While @@fetch_status = 0
begin
Alter index all on @table_name
REBUILD WITH (FILLFACTOR=80, ONLINE=ON)
fetch next from table_cursor into @table_name
end
Close table_cursor
deallocate table_cursor
取得エラー
@table_name 付近の構文が正しくありません