FROM sysobjects
WHERE xtype = 'U' order by name
open c1
fetch next from c1 into @table_name
while @@Fetch_Status = 0
begin
print(@table_name)
DBCC DBREINDEX (@table_name, '')
fetch next from c1 into @table_name
end
print('finished')
close c1
deallocate c1
GO
DECLARE @table_name varchar(1000),@sql nvarchar(4000)
declare c1 cursor for SELECT name
FROM sysobjects
WHERE xtype = 'U' order by name
open c1
fetch next from c1 into @table_name
while @@Fetch_Status = 0
begin
print(@table_name)
Select @sql = 'UPDATE STATISTICS '+ @table_name +' WITH FULLSCAN'
exec sp_executesql @sql
fetch next from c1 into @table_name
end
print('finished')
close c1
deallocate c1
GO
2. Execute the script against your Cisco TMS database by entering the following command in a
command prompt. Replace server with localhost or localhost\sqltms depending on your
installation
osql –E –S server –d tmsng –i update.txt
Extra reference links
Upgrading MSDE 2000 to SQL Server 2005 Express
SQL Server 2005 Express Download
Microsoft .NET Framework 2.0 Service Pack 1 (x86)
SQL Server Management Studio Express Download
Cisco TMS Database Knowledge Tips
Tips category – Maintaining/Upkeep
Page 33 of 35
Need help?
Do you have a question about the TMS SQL DATABASE and is the answer not in the manual?
Questions and answers