DECLARE @TabName varchar(100)
Declare @T1 varchar(100)
DECLARE Recreateindex CURSOR FOR select table_name from information_schema.tables OPEN Recreateindex
FETCH NEXT FROM Recreateindex INTO @TabName
WHILE @@FETCH_STATUS = 0
BEGIN
set @t1=@TabName
DBCC DBREINDEX (@T1)
-- print
Fetch NEXT FROM Recreateindex INTO @TabName
END
CLOSE Recreateindex
DEALLOCATE Recreateindex
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment