home *** CD-ROM | disk | FTP | other *** search
-
-
- CREATE PROCEDURE msmq_update_statistics
- as
-
-
-
-
- declare listtables cursor
- for select name from sysobjects where type = 'U' for read only
-
- declare @name varchar(40)
-
-
-
-
- open listtables
-
-
-
-
- fetch next from listtables into @name
-
-
-
-
- while @@fetch_status = 0
- begin
-
-
-
- EXECUTE ("UPDATE STATISTICS " + @name)
-
-
-
- fetch next from listtables into @name
-
- end
-
-
-
-
- deallocate listtables
-
- go
-
- use msdb
- go
-
- EXECUTE sp_addtask @name = 'msmq_update_statistics', @databasename = 'mqis',
- @enabled = 1, @freqtype = 4, @freqinterval = 1,
- @activestarttimeofday = 000000, @command = 'msmq_update_statistics'
- go
-
-
-
-
-
-